可能重复:
php == vs === operator
Reference - What does this symbol mean in PHP?==和===有什么区别?
在PHP中,是什么==
和===
之间的区别?另外,!=
和!==
有什么区别?感谢帮助!
可能重复:
php == vs === operator
Reference - What does this symbol mean in PHP?==和===有什么区别?
在PHP中,是什么==
和===
之间的区别?另外,!=
和!==
有什么区别?感谢帮助!
从http://us.php.net/manual/en/language.operators.comparison.php
$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.
$a != $b Not equal TRUE if $a is not equal to $b after type juggling.
$a <> $b Not equal TRUE if $a is not equal to $b after type juggling.
$a !== $b Not identical TRUE if $a is not equal to $b, or they are not of the same type.
只是为了增加一个例子:0 == false,但是0!== false,它是使用strpos函数的最好例子(http:// php。 net/manual/de/function.strpos.php) – roman 2012-02-02 17:14:37
我很感激! – 2012-02-02 17:14:53
真棒!我问这个问题的全部原因实际上与'strpos()'有关! – 2012-02-02 17:16:02
让我猜猜,你花任何时间使用Google呢? – 2012-02-02 17:10:42
请注意,在此网站上搜索“PHP ===”没有帮助。 – tster 2012-02-02 17:12:14
是啊! – 2012-02-02 17:14:22