xxxxxxxxxx
$all_arrays = array_merge($array1, $array2, $array3, );
xxxxxxxxxx
<?php
$array1 = [
"color" => "green"
];
$array2 = [
"color" => "red",
"color" => "blue"
];
$result = array_merge($array1, $array2);
// $result
[
"color" => "blue",
]
xxxxxxxxxx
$a1=array("red","green");
$a2=array("blue","green","yellow");
print_r(array_merge($a1,$a2));
xxxxxxxxxx
<?php
$array1 = array(1,2,3);
$array2 = array(4,5,6);
$arrays = array($array1, $array2);
$flat_array = array_merge($arrays);
?>
flatten array of arrays