generating result array with 2 array code example
Example 1: php combine arrays
$output = array_merge($array1, $array2);
Example 2: array merge in php
<?php
$a1=array("red","green");
$a2=array("blue","green","yellow");
print_r(array_merge($a1,$a2));
?>
<?php
$a1=array("a"=>"red","b"=>"green");
$a2=array("c"=>"blue","b"=>"yellow");
print_r(array_merge($a1,$a2));
?>
Example 3: merge two arrays one as key to another php
array_combine ( array $keys , array $values );
Example 4: php combine values of two arrays
$all_arrays = array_merge($array1, $array2, $array3, ...);