What is the difference between == and === in php
Possible Duplicate:
The 3 different equals
Is there any difference between == and === in php? both seem to work fine for me when i use them in a conditional statement. I am very new to programming in PHP. Please consider this and answer in simple words.
$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
链接地址: http://www.djcxy.com/p/58454.html下一篇: 在PHP中==和===有什么区别