Mobile_detect is a lightweight, open source mobile device (mobile) detection PHP Class,
It uses the string in User-agent and combines the HTTP Header to detect the mobile device environment.
The most powerful part of the PHP class library that this device detects is that it has a very complete library,
You can detect the type of device you are using (including the type of operation, as well as the ability to detect your phone's brand, etc.) and the browser's details.
The complete Mobile_detect code is as follows:
Include ' mobile_detect.php '; $detect = new Mobile_detect (); Check for any mobile Device.if ($detect->ismobile ())//check for any tablet.if ($detect->istablet ())//Check for Any mobile device, excluding Tablets.if ($detect->ismobile () &&! $detect->istablet ()) if ($detect, IsMobile () && $detect->istablet ())//Alternative to $detect->isandroidos () $detect->is (' Androidos ' ); Batch Usageforeach ($userAgents as $userAgent) { $detect->setuseragent ($userAgent); $isMobile = $detect->ismobile ();} Version check. $detect->version (' IPad '); 4.3 (float)
http://www.bkjia.com/PHPjc/477164.html www.bkjia.com true http://www.bkjia.com/PHPjc/477164.html techarticle Mobile_detect is a lightweight, open source mobile device (mobile phone) detection PHP Class that uses strings in User-agent and combines HTTP headers to detect the mobile environment. ...