锟斤拷锟斤拷 | 锟斤拷锟斤拷 | 锟斤拷锟� |
---|---|---|
$a + $b | 锟斤拷锟斤拷 | $a 锟斤拷 $b 锟斤拷锟斤拷锟较★拷 |
$a == $b | 锟斤拷锟� | 锟斤拷锟� $a 锟斤拷 $b 锟斤拷锟斤拷锟斤拷同锟侥硷拷锟斤拷值锟斤拷锟斤拷为 TRUE 锟斤拷 |
$a === $b | 全锟斤拷 | 锟斤拷锟� $a 锟斤拷 $b 锟斤拷锟斤拷锟斤拷同锟侥硷拷锟斤拷值锟皆诧拷锟斤拷顺锟斤拷锟斤拷锟斤拷投锟斤拷锟酵拷锟轿� TRUE 锟斤拷 |
$a != $b | 锟斤拷锟斤拷 | 锟斤拷锟� $a 锟斤拷锟斤拷锟斤拷 $b 锟斤拷为 TRUE 锟斤拷 |
$a <> $b | 锟斤拷锟斤拷 | 锟斤拷锟� $a 锟斤拷锟斤拷锟斤拷 $b 锟斤拷为 TRUE 锟斤拷 |
$a !== $b | 锟斤拷全锟斤拷 | 锟斤拷锟� $a 锟斤拷全锟斤拷锟斤拷 $b 锟斤拷为 TRUE 锟斤拷 |
+ 锟斤拷锟斤拷锟斤拷锟斤拷冶叩锟斤拷锟斤拷锟皆拷馗锟斤拷拥锟斤拷锟竭碉拷锟斤拷锟斤拷锟斤拷妫拷锟斤拷锟斤拷锟斤拷锟斤拷卸锟斤拷械募锟斤拷锟斤拷锟斤拷锟街伙拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫的o拷锟揭边的憋拷锟斤拷锟皆★拷
<?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: \n";
var_dump($c);
$c = $b + $a; // Union of $b and $a
echo "Union of \$b and \$a: \n";
var_dump($c);
$a += $b; // Union of $a += $b is $a and $b
echo "Union of \$a += \$b: \n";
var_dump($a);
?>
Union of $a and $b: 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" } Union of $a += $b: array(3) { 'a' => string(5) "apple" 'b' => string(6) "banana" 'c' => string(6) "cherry" }
锟斤拷锟斤拷锟叫的碉拷元锟斤拷锟斤拷锟斤拷锟斤拷锟酵拷募锟斤拷锟斤拷锟街碉拷锟饺斤拷时锟斤拷取锟�
Example #1 锟饺斤拷锟斤拷锟斤拷
<?php
$a = array("apple", "banana");
$b = array(1 => "banana", "0" => "apple");
var_dump($a == $b); // bool(true)
var_dump($a === $b); // bool(false)
?>
锟轿硷拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟介函锟斤拷锟铰节★拷