Str*_*rry 147 php comparison operators
是什么区别=
,==
和===
?
我认为使用一个等号是声明一个变量,而两个等号用于比较条件,最后三个等号用于比较声明变量的值.
gna*_*arf 170
你=
的赋值操作符,==
在"平等"比较操作和===
对"相同"的比较操作.
$a = $b Assign Sets $a to be equal to $b.
$a == $b Equal TRUE if $a is equal to $b.
$a === $b Identical TRUE if $a is equal to $b, and they are of the same type. (introduced in PHP 4)
Run Code Online (Sandbox Code Playgroud)
有关需要更多信息==
和===
和的情况下使用每个,看的文档.