php判断客户端是否为手机_PHP教程
时间:2021-07-01 10:21:17
帮助过:5人阅读
//php判断客户端是否为手机
$agent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($agent,"NetFront") || 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:xxxxxxxx");
?>
摘自 chaojie2009的专栏
http://www.bkjia.com/PHPjc/478375.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478375.htmlTechArticle?php //php判断客户端是否为手机 $agent = $_SERVER[HTTP_USER_AGENT]; if(strpos($agent,NetFront) || strpos($agent,iPhone) || strpos($agent,MIDP-2.0) || strpos($agent,Opera Mi...