if we have 5 different array how to merge them in single array in php -
i have 5 different array structure :-
array ( [0] => http://www.php.net/200 ) array ( [0] => http://www.php.net/?setbeta=1&beta=1302 ) array ( [0] => http://www.php.net/downloads.php200 ) array ( [0] => http://www.php.net/docs.php200 ) array ( [0] => http://www.php.net/faq.php302 )
i need merge these in single array structure like:-
array ( [0] => http://www.php.net/200 [1] => http://www.php.net/?setbeta=1&beta=1302 [2] => http://www.php.net/downloads.php200 [3] => http://www.php.net/docs.php200 [4] => http://www.php.net/faq.php302 )
one thing want confirm these arrays forming inside loop function , of number , have single name i.e $array
use array_merge
.
$arr = array_merge($arr1,$arr2,$arr3,$arr4,$arr5);
edit after seeing comment, having multidimensional array.
$arr = array(); for($i = 0; $i < $old_arr; $i++) { $arr[] = $old_arr[$i][0]; }
Comments
Post a Comment