How to determine whether to use PC-side or mobile-browsing Web page?
Reply content:
How to determine whether to use PC-side or mobile-browsing Web page?
PHP
There's a library of cell phone tests.Mobile-Detect
Address: Https://packagist.org/packages/mobiledetect/mobiledetectlib
0. $matches [0]: "; function Checksubstrs ($substrs, $text) {foreach ($substrs as $substr) {if (False!==strpos ($text, $substr)) { return true; }else{return 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 ', ' 320x ' Up. ' Browser ', ' up. Link ', ' SymbianOS ', ' PalmOS ', ' PocketPC ', ' SonyEricsson ', ' Nokia ', ' BlackBerry ', ' Vodafone ', ' BenQ ', ' novarra-vision ', ' Iris ', ' NetFront ', ' htc_ ', ' Xda_ ', ' samsung-sgh ', ' Wapaka ', ' DoCoMo ', ' iPhone ', ' iPod '; $found _mobile=checksubstrs ($mobile _os_list, $useragent _commentsblock) | | Checksubstrs ($mobile _token_list, $useragent); if ($found _mobile) {return true; }else{return false; }}if (iSmobile ()) echo ' phone '; Elseecho ' pc ';? >
Detailed Link Link description
Judging UA chant.