merge key value array php code example
Example 1: php combine arrays
$output = array_merge($array1, $array2);
Example 2: merge two arrays one as key to another php
// two arrays one become keys and second becomes values
array_combine ( array $keys , array $values );
Example 3: associative array in php have same value join them
<?php
$a = array('green', 'red', 'yellow');
$b = array('avocado', 'apple', 'banana');
$c = array_combine($a, $b);
print_r($c);
?>