php: 0跟字符串做比较永远是true。 php大bug。

Posted 穆晟铭

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php: 0跟字符串做比较永远是true。 php大bug。相关的知识,希望对你有一定的参考价值。

php: 0跟字符串做比较永远是true。 php大bug。

如:

$a = 0;

if( $a == ‘excel‘)

{

echo "yes";

}else{

echo "no";

}

 

你没想到吧,得到的结果是true,,输出:yes.

 

以上是关于php: 0跟字符串做比较永远是true。 php大bug。的主要内容,如果未能解决你的问题,请参考以下文章