PHP判断是否是手机浏览器
//是否是手机浏览
function is_mobile(){
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
$uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i";
if($ua == '' || preg_match($uachar, $ua))
{
return true;
} else{
return false;
}
}