include 'Mobile_Detect.php'; $detect = new Mobile_Detect(); // Check for any mobile device. if ($detect->isMobile()) // Check for any tablet. if($detect->isTablet()) // 3. Check for any mobile device, excluding tablets. if ($detect->isMobile() && !$detect->isTablet())
// Alternative to $detect->isAndroidOS()
$detect->is('AndroidOS');
// Batch usage
foreach($userAgents as $userAgent){
$detect->setUserAgent($userAgent);
$isMobile = $detect->isMobile();
}
// Version check.
$detect->version('iPad'); // 4.3 (float)
Sponsored by BrowserStack the complete browser coverage tool (including mobile devices) for testing you web application.