<?php
$ua = strtolower($_SERVER[‘HTTP_USER_AGENT‘]);
$uachar =
"/(iphone|android|phone|mobile|wap|netfront|java|opera mobi|opera
mini|ucweb|windows
ce|symbian|series|webos|sony|blackberry|dopod|nokia|samsung|palmsource|xda|pieplus|meizu|midp|cldc|motorola|foma|docomo|up.browser|up.link|blazer|helio|hosin|huawei|novarra|coolpad|webos|techfaith|palmsource|alcatel|amoi|ktouch|nexian|ericsson|philips|sagem|wellcom|bunjalloo|maui|smartphone|iemobile|spice|bird|zte-|longcos|pantech|gionee|portalmmm|jig
browser|hiptop|benq|haier|^lct|320x320|240x320|176x220)/i";
if(($ua == ‘‘
|| preg_match($uachar, $ua))&&
!strpos(strtolower($_SERVER[‘REQUEST_URI‘]),‘wap‘))
{
exit(header(‘location:跳转手机版本!‘));
}
?>
相关文章
- 06-07PHP判断访问者是PC端还是移动端
- 06-07php判断终端是手机还是电脑访问网站代码
- 06-07PHP 判断终端是手机还是电脑访问网站代码
- 06-07js判断是手机端还是pc端访问
- 06-07php如何判断是手机访问还是电脑访问
- 06-07php判断访问的当前设备是手机还是电脑
- 06-07php怎么判断网页是电脑访问还是手机访问
- 06-07获取网页是手机端还是PC端访问
- 06-07php 判断设备是手机还是平板还是pc
- 06-07thinkphp 检测访问来源是来自手机还是PC