PHP SCRIPT TO DETECT MOBILE
I AM NOT THE AUTHOR. DONT FORGET TO CLICK THANKS.
Usage
Include and instantiate the class:
Check for a specific platform:
Other case insensitive available methods are isIphone(), isIpad(), isBlackBerry(), isKindle(), isOpera(), etc. For the full list of available methods check the demo.php.
Alternatively, if you are only interested in checking to see if the user is using a mobile device, without caring for specific platform:
I AM NOT THE AUTHOR. DONT FORGET TO CLICK THANKS.
Usage
Include and instantiate the class:
PHP Code:
include("Mobile_Detect.php");
$detect = new Mobile_Detect();
PHP Code:
if($detect->isiOS()){
// code to run for the Apple iOS platform.
}
if($detect->isAndroidOS()){
// code to run for the Google Android platform.
}
Alternatively, if you are only interested in checking to see if the user is using a mobile device, without caring for specific platform:
PHP Code:
if ($detect->isMobile()) {
// any mobile platform
}
if($detect->isTablet()){
// any tablet
}
PHP Code:
Details
Use isMobile() for detecting any kind of mobile device
Use isTablet() for detecting tablet devices
Test your device online at http://is.gd/mobiletest
Further detection
You can detect specific devices by using case-insensitive pseudo-methods.
Phones
isiPhone()
isBlackBerry()
isHTC()
isNexus()
isDellStreak()
isMotorola()
isSamsung()
isSony()
isAsus()
isPalm()
isGenericPhone()
Tablets
isBlackBerryTablet()
isiPad()
isKindle()
isSamsungTablet()
isHTCtablet()
isMotorolaTablet()
isAsusTablet()
isNookTablet()
isAcerTablet()
isYarvikTablet()
isGenericTablet()
Operating systems
isAndroidOS()
isBlackBerryOS()
isPalmOS()
isSymbianOS()
isWindowsMobileOS()
isiOS()
isFlashLiteOS()
isJavaOS()
isNokiaOS()
iswebOS()
isbadaOS()
isBREWOS()
Mobile browsers
isChrome()
isDolfin()
isOpera()
isSkyfire()
isIE()
isFirefox()
isBolt()
isTeaShark()
isBlazer()
isSafari()
isMidori()
isGenericBrowser()
Comment