PHP的,如果iPad无法正常工作

用户名
<?php if(strstr($SERVER['HTTP_USER_AGENT'],'iPad')){ ?>

<link rel="stylesheet" type="text/css" href="http://artendijen.com/wp-content/themes/twentytwelve/styleTablet.css">

<?php } ?>

我正在尝试检测用户代理是否为iPad,但是上面的以下语法不起作用,我对CSS文件中的元素应用了display none的显示方式,并删除了php if语句,并检查了我的ipad和该元素是否不存在。

帕里克斯

这是代码:

<?php if(stripos($SERVER['HTTP_USER_AGENT'],'iPad') !== false){ ?>
<!--here if its ipad-->
<link rel="stylesheet" type="text/css" href="http://artendijen.com/wp-content/themes/twentytwelve/styleTablet.css">

<?php } ?>

这就是ipad的用户代理

Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10

请看这里

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章