Function Getbrowsertype () {
$is _mobile = false;
$mobile _os_list=array (' Google Wireless transcoder ', ' Windows CE ', ' windowsce ', ' Symbian ', ' Android ', ' armv6l ', ' armv5 ', ' Mobile ', ' CentOS ', ' mowser ', ' AvantGo ', ' Opera Mobi ', ' J2ME/MIDP ', ' Smartphone ', ' go.web ', ' Palm ', ' IPAQ ');
$mobile _token_list=array (' PROFILE/MIDP ', ' configuration/cldc-', ' 160x160 ', ' 176x220 ', ' 240x240 ', ' 240x320 ', ' 320 x240 ', ' up. Browser ', ' up. Link ', ' SymbianOS ', ' PalmOS ', ' PocketPC ', ' SonyEricsson ', ' Nokia ', ' BlackBerry ', ' Vodafone ', ' BenQ ', ' novarra-vision ', ' Iris ', ' NetFront ', ' htc_ ', ' Xda_ ', ' samsung-sgh ', ' Wapaka ', ' DoCoMo ', ' iPhone ', ' iPod ';
$is _mobile = false;
foreach ($mobile _os_list as $key = + $value) {
if (Strpos ($_server[' http_user_agent '), $value)) {
$is _m Obile = true;
}
}
foreach ($mobile _token_list as $key = + $value) {
if (Strpos ($_server[' http_user_agent '), $valu e) {
$is _mobile = true;
}
}
return $is _mobile;
}
If it is the phone side, return true, if it is the PC side, return false, with this code can be at the domain name entrance to make judgments.
PHP Determines whether the user is a PC-side or mobile access method