Home  >  Article  >  Backend Development  >  来来来!大家看上这么恶搞的php

来来来!大家看上这么恶搞的php

WBOY
WBOYOriginal
2016-06-13 13:15:421020browse

来来来!~~大家看下这么恶搞的php
$a="3300";
$b="3300.";
$c="2.0absd";
echo ($b-6)."
";//3294
echo ($c-6)."
";//-4
if($a==$b)
{
echo "相等
";//相等
}
echo strcmp($a,$b);//-1
?>

------解决方案--------------------
if($a==$b) //php会转化为整数比较 3300==3300

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn