- /**
- * 检查是否是以手机浏览器进入(IN_MOBILE)
- */
- function isMobile() {
- $mobile = array();
- static $mobilebrowser_list ='Mobile|iPhone|Android|WAP|NetFront|JAVA|OperasMini|UCWEB|WindowssCE|Symbian|Series|webOS|SonyEricsson|Sony|BlackBerry|Cellphone|dopod|Nokia|samsung|PalmSource|Xphone|Xda|Smartphone|PIEPlus|MEIZU|MIDP|CLDC';
- //note 获取手机浏览器
- if(preg_match("/$mobilebrowser_list/i", $_SERVER['HTTP_USER_AGENT'], $mobile)) {
- return true;
- }else{
- if(preg_match('/(mozilla|chrome|safari|opera|m3gate|winwap|openwave)/i', $_SERVER['HTTP_USER_AGENT'])) {
- return false;
- }else{
- if($_GET['mobile'] === 'yes') {
- return true;
- }else{
- return false;
- }
- }
- }
- }
时间: 2024-11-22 21:09:29