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 device environment. The most powerful thing about the PHP class library that this device detects is that it has a very complete library that detects the type of device used (including the type of operation, as well as the ability of the phone's brand to detect) and the browser's details.
http://mobiledetect.net/
Use instance 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)
Source: http://www.oschina.net/code/snippet_118180_16788
The above describes the detection of mobile devices (mobile phone) PHP class library, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.