function is_wap()
{
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
$uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|sie|philips|panasonic|alcatel|lenovo|cldc|midp|wap|mobile)/i";
if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))
{//如果在访问的URL中已经找到 wap字样,表明已经在访问WAP页面,无需跳转,下一版本增加 feed访问时也不跳转
return true;
}else{
return false;
}
}