wotw Posted January 17, 2013 Share Posted January 17, 2013 Hey, Could someone help me move these arrays into one array please? i.e move them up one level. Array ( [0] => Array ( [0] => content_first ) [1] => Array ( [0] => content_again [1] => content ) } Thanks. Link to comment https://forums.phpfreaks.com/topic/273258-move-arrays-up/ Share on other sites More sharing options...
trq Posted January 17, 2013 Share Posted January 17, 2013 array_merge Link to comment https://forums.phpfreaks.com/topic/273258-move-arrays-up/#findComment-1406266 Share on other sites More sharing options...
wotw Posted January 19, 2013 Author Share Posted January 19, 2013 Problem with using is the array is built like this: function files(){ $file_array = $this->files; $files = array(); foreach($file_array as $value){ $files[] = $value['files']; } return $files; } That funcxtion is from a class file. That functiopn returns the array posted above. How can I make all the valueas into one array mate? Link to comment https://forums.phpfreaks.com/topic/273258-move-arrays-up/#findComment-1406924 Share on other sites More sharing options...
silkfire Posted January 19, 2013 Share Posted January 19, 2013 Replace the line: $files[] = $values['files']; with $files = array_merge($files, $values['files']); Link to comment https://forums.phpfreaks.com/topic/273258-move-arrays-up/#findComment-1406927 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.