手机访问网站自动跳转到手机版

$agent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($agent,"comFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS"))
header("Location:http://m.baidu.com/");

 

posted @ 2015-03-11 14:15  ITCAICAI  阅读(202)  评论(0编辑  收藏  举报