array_merge( ) function combines two or more arrays by renumbering numerical indexes and overwriting string indexes
array array_merge ( array arr1 [, array arr2 [, array ...]] )
<?
$toppings1 = array("Pepperoni", "Cheese", "Anchovies", "Tomatoes");
$toppings2 = array("Ham", "Cheese", "Peppers");
$both_toppings = array_merge($toppings1, $toppings2);
var_dump($both_toppings);
?>
Related examples in the same category