php - Merge multidimesional and associative arrays -
i'm trying merge 2 given arrays new one:
first array:
array ( [0] =>; array ( [label] => please choose [value] => default ) )
second array:
array ( [label] => 14.09.2013 - 27.09.2013 - 3.299 € [value] => 14.09.2013 - 27.09.2013 )
i want generate arrays looks this:
array ( [0] => array ( [label] => please choose [value] => 14.09.2013 - 27.09.2013 ), [1] => array ( [label] => 14.09.2013 - 27.09.2013 - 3.299 € [value] => 14.09.2013 - 27.09.2013 ) )
i tried merge arrays:
array_merge($array1,$array2);
which results in:
array ( [0] => array ( [label] => please choose [value] => default ) [label] => 14.09.2013 - 27.09.2013 - 3.299 € [value] => 14.09.2013 - 27.09.2013 )
what appropriate function use-case?
if pass in 2nd array inside array should desired output
array_merge($array1,array(1 => $array2));
Comments
Post a Comment