array_merge() example : array_merge « Data Structure « PHP






array_merge() example

 
<?
$array1 = array ("color" => "red", 2, 4);
$array2 = array ("a", "b", "color" => "green", "shape" => "trapezoid");
array_merge ($array1, $array2);
?>
  
  








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() function merges 1 to N arrays together
8.obtaining the union of two arrays