PHP 在数组中加法运算操作实例代码
来源:未知 责任编辑:智问网络 发表时间:2013-11-04 19:50 点击:次
PHP 在数组中加法运算操作实例代码
- <?php
- $a = array("a" => "apple", "b" => "banana");
- $b = array("a" => "pear", "b" => "strawberry", "c" => "cherry");
- $c = $a $b; // Union of $a and $b
- echo "Union of $a and $b: ";
- var_dump($c);
- $c = $b $a; // Union of $b and $a
- echo "Union of $b and $a: ";
- var_dump($c);
- ?>
- <?php
- array(3) {
- ["a"]=>
- string(5) "apple"
- ["b"]=>
- string(6) "banana"
- ["c"]=>
- string(6) "cherry"
- }
- Union of $b and $a:
- array(3) {
- ["a"]=>
- string(4) "pear"
- ["b"]=>
- string(10) "strawberry"
- ["c"]=>
- string(6) "cherry"
- }
- ?>
相关新闻>>
- 发表评论
-
- 最新评论 更多>>