根据终端判断跳转

根据终端判断跳转,如果是手机则跳转到百度

<?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://www.baidu.com");
?>
posted @ 2013-11-25 12:47  perseus  阅读(153)  评论(0)    收藏  举报