arrays - PHP array_chunk and then array_merge -


is there way merge undefined number of arrays? array_merge doesn't work me, cause have put arrays parameters, or maybe there way.

i've chunked array n - number of arrays, stuff on chunks , merge other arrays:

$chunky = array_chunk($positions); $arraytomerge = array(); foreach($chunky $key=>$val) {     stuff $keys , $vals     $arraytomerge[] = array('1','2','3','4'); } $merged = array_merge($arraytomerge[0],$arraytomerge[1]...); 

how list arrays array_merge parameters?

instead of doing

//do stuff $keys , $vals $arraytomerge[] = array('1','2','3','4'); 

just

//do stuff $keys , $vals $merged = array_merge($merged,array('1','2','3','4')); 

or better yet, add new items directly $merged array instead of creating new array


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -