$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
$uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile|wap)/i";
if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))
{
header("Location: http://www.xx.com");
}else{
header("Location: http://www.00.com");
}
echo "<br/>".$ua;
PHP判断PC端和手机端
最新推荐文章于 2021-03-27 19:21:27 发布