Code:
Copy code The code is as follows:
$a = array('a' = > 'a', 'b' => 'b');
$b = array('c' => 'c', 'd' => 'd');
$ c = $a + $b;
print('
'); <br>print_r($c); <br>print('
');
?>
Result:
Copy code The code is as follows:
Array
(
[a] => a
[b] => b
[c] => c
[d] => d
)
Note: There is still a difference between the plus sign and the array_merge() function, that is, when using the plus sign to merge arrays, if there are keys with the same name between the arrays, the key values corresponding to the previous arrays will be retained, while the array_merge() function is just the opposite.
http://www.bkjia.com/PHPjc/322799.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/322799.htmlTechArticleCode: Copy the code as follows: ?php $a = array('a' = 'a', 'b ' = 'b'); $b = array('c' = 'c', 'd' = 'd'); $c = $a + $b; print('pre'); print_r($c) ; print('/pre'); ? Result: Copy...