手机访问pc网站自动跳转手机端网站PHP代码

 

 

$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://chinahoby");

 

你可能感兴趣的:(PHP)