array_merge() function merges 1 to N arrays together : array_merge « Data Structure « PHP






array_merge() function merges 1 to N arrays together

 
The function's syntax is: array array_merge (array array1, array array2, . . ., array arrayN)
<?
    $arr_1 = array ("s", "g", "l");
    $arr_2 = array ("b", "c", "l");
    $arr_3 = array ("p", "o");
    
    $arr_4 = array_merge ($arr_2, $arr_1, $arr_3);
    print_r($arr_4);
?>
  
  








Related examples in the same category

1.Appending One Array to Another
2.Using array_merge() and the + operator with associative arrays as well
3.array_merge
4.array_merge( ) function combines two or more arrays by renumbering numerical indexes and overwriting string indexes
5.array_merge( ) retains array keys when possible.
6.array_merge() and + operator
7.array_merge() example
8.obtaining the union of two arrays