najibla Posted March 27, 2013 Share Posted March 27, 2013 Is there any way to transform an array looking like this: Array ( [level-1] => 2 [quarter-1] => 1 [year-1] => 2014 [level-2] => 2 [quarter-2] => 2 [year-2] => 2015 [level-49] => 2 [quarter-49] => 2 [year-49] => 2015 [level-58] => 1 [quarter-58] => 1 [year-58]and take only the numbers after the keywords to use them in an sql table. For example, the table would look like: ID 1 Level 2 Quarter 1 Year 2014 ID 2 level 2 quater 2 Year 2015 ID 49 level 2 quarter 2 year 2015Etc Link to comment https://forums.phpfreaks.com/topic/276213-extract-information-from-an-array/ Share on other sites More sharing options...
trq Posted March 27, 2013 Share Posted March 27, 2013 Yes, see preg_split. Link to comment https://forums.phpfreaks.com/topic/276213-extract-information-from-an-array/#findComment-1421372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.