Is there any difference between ==
开发者_开发问答and ===
in PHP? Both seem to work fine for me when i use them in a conditional statement.
$a == $b
Equal true: if $a
is equal to
$b
, after type juggling.
$a === $b
Identical true: if $a
is equal to $b
, and they are of the same type.
Identical:
$a === $b
TRUE
if $a
is equal
to $b
, and they are of the same type. (introduced in PHP 4
)
Equal:
$a == $b
TRUE
if $a
is equal to $b
after type juggling.
Read here for more: http://www.php.net/manual/en/language.operators.comparison.php
精彩评论