当前位置:

PHP网站判断手机移动设备

xiaoming 2023-01-19 127 0

function is_mobile() { $user_agent = $_SERVER[HTTP_USER_AGENT]; $mobile_browser = Array( "mqqbrowser", //手机QQ浏览器 "opera mobi", //手机opera "juc","iuc",//uc浏览器 "fennec","ios","applewebKit/420","applewebkit/525","applewebkit/532","ipad","iphone","ipaq","ipod", "iemobile", "windows ce",//windows phone "240x320","480x640","acer","android","songzhenjiang.cn","asus","audio","blackberry","blazer","coolpad" ,"dopod", "etouch", "hitachi","htc","huawei", "jbrowser", "lenovo","lg","lg-","lge-","lge", "mobi","moto","nokia","phone","samsung","sony","symbian","tablet","tianyu","wap","xda","xde","zte" ); $is_mobile = false; foreach ($mobile_browser as $device) { if (stristr($user_agent, $device)) { $is_mobile = true; break; } } return $is_mobile; }

PHP网站判断手机移动设备

发表评论

  • 评论列表
还没有人评论,快来抢沙发吧~
您是本站第4730名访客 今日有1篇新文章