==和===有什么区别?

时间:2012-02-02 17:09:26

标签: php

  

可能重复:
  php == vs === operator
  Reference - What does this symbol mean in PHP?

在PHP中,=====之间有什么区别?另外,!=!==之间有什么区别?感谢帮助!

1 个答案:

答案 0 :(得分:3)

来自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.