实例 PHP 数组运算符 +

x
 
<!DOCTYPE html>
<html>
<body>
<?php
$x = array("a" => "apple", "b" => "banana");  
$y = array("c" => "orange", "d" => "peach");  
print_r($x + $y); // 联合 $x 和 $y
?>  
</body>
</html>
                    

输出结果





Array
(
[a] => apple
[b] => banana
[c] => orange
[d] => peach
)