Php mobile detect

Started on the old forum in September 2012 · view the original in the archive · old links redirect here

5 replies · 1,269 views · started 14 years ago · 1 min read

5 participants
tkreturns Developer · 98 posts #1

PHP SCRIPT TO DETECT MOBILE I AM NOT THE AUTHOR. DONT FORGET TO CLICK THANKS. 🙂 Usage Include and instantiate the class:

include("Mobile_Detect.php");
$detect = new Mobile_Detect();

Check for a specific platform:

if($detect->isiOS()){
    // code to run for the Apple iOS platform.
}
if($detect->isAndroidOS()){
    // code to run for the Google Android 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:

if ($detect->isMobile()) {
    // any mobile platform
}
if($detect->isTablet()){
    // any tablet
}
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()

ASK FOR HELP

BioBeo Developer · 67 posts #4

nyc share.. tnx.

No one could help you If you don't help yourself. My facebook

rusith Newbie · 5 posts #5

whats for use this?

tkreturns wrote: PHP SCRIPT TO DETECT MOBILE I AM NOT THE AUTHOR. DONT FORGET TO CLICK THANKS. 🙂 Usage Include and instantiate the class:

include("Mobile_Detect.php");
$detect = new Mobile_Detect();

Check for a specific platform:

if($detect->isiOS()){
    // code to run for the Apple iOS platform.
}
if($detect->isAndroidOS()){
    // code to run for the Google Android 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:

if ($detect->isMobile()) {
    // any mobile platform
}
if($detect->isTablet()){
    // any tablet
}
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()

cani use this for download site??? or chat community site(lavalair, retrivewap). and ow to do it?

tkreturns Developer · 98 posts #6

@ rusith yep u can make it work with any script. Pm If u need any help

ASK FOR HELP

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close