$screenx = "<script>document.write(screen.width);</script>";
echo $screenx;
现在我浏览器的宽度为1024 输出结果为1024。 一切正常,OK。 $aa=$screenx +100;
echo $aa;
现在+100之后, 居然aa 的值=100 什么原因? 难道$screenx =0 ?
求老手回答
echo $screenx;
现在我浏览器的宽度为1024 输出结果为1024。 一切正常,OK。 $aa=$screenx +100;
echo $aa;
现在+100之后, 居然aa 的值=100 什么原因? 难道$screenx =0 ?
求老手回答
echo '正常';
}else{
echo '不正常';
}结果为: 不正常。
为什么我这样$screenx=$aa
echo $aa;$aa 是有值的,为什么$aa还能赋值呢?
如果把它当做数,那么就是 0
于是 $aa=$screenx +100; 后
$aa 等于 100
$aa=$screenx +100; //与整形计算时,字符串要转化才整形,0+100 = 100