php中使用js得到的值,无法进行比较吗?$width.="<script>";
$width.="document.write(window.screen.width);";
$width.="</script>";
$isMobile = ($width > 600)?'0':'1';
echo $isMobile;isMobile的值会一直是1,如果int($width)强转,那么int($width)的值会是0。
$width.="document.write(window.screen.width);";
$width.="</script>";
$isMobile = ($width > 600)?'0':'1';
echo $isMobile;isMobile的值会一直是1,如果int($width)强转,那么int($width)的值会是0。
就算在本机测试,也是“模拟”,过程仍然是按两台机器
你这就包括width= 整段你输的文本了
else echo "<script>location.replace('?screen_width=' + window.screen.width)</script>";