happypete Posted March 2, 2014 Share Posted March 2, 2014 (edited) Hi, I'm trying to combine an array (if that's the right way to describe it..??) I have this Array ( [0] => Array ( [0] => 2013-07-14 [1] => 2013-07-15 [2] => 2013-07-16 [3] => 2013-07-17 ) [1] => Array ( [0] => 2013-08-02 [1] => 2013-08-03 [2] => 2013-08-04 [3] => 2013-08-05 [4] => 2013-08-06 ) [2] => Array ( [0] => 2013-10-06 [1] => 2013-10-07 [2] => 2013-10-08 [3] => 2013-10-09 ) ) and i want this: Array ( [0] => 2013-07-14 [1] => 2013-07-15 [2] => 2013-07-16 [3] => 2013-07-17 [4] => 2013-08-02 [5] => 2013-08-03 [6] => 2013-08-04 [7] => 2013-08-05 [8] => 2013-08-06 [9] => 2013-10-06 [10] => 2013-10-07 [11] => 2013-10-08 [12] => 2013-10-09 ) Edited March 2, 2014 by happypete Quote Link to comment https://forums.phpfreaks.com/topic/286665-combining-array/ Share on other sites More sharing options...
Solution requinix Posted March 3, 2014 Solution Share Posted March 3, 2014 array_reduce and array_merge: array_reduce($array, "array_merge", array()) Quote Link to comment https://forums.phpfreaks.com/topic/286665-combining-array/#findComment-1471279 Share on other sites More sharing options...
happypete Posted March 3, 2014 Author Share Posted March 3, 2014 array_reduce and array_merge: array_reduce($array, "array_merge", array()) thanks. that didn't work for me, but this did: $array = call_user_func_array('array_merge', $array); Quote Link to comment https://forums.phpfreaks.com/topic/286665-combining-array/#findComment-1471280 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.