Php mobile detect

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Php mobile detect

    PHP SCRIPT TO DETECT MOBILE
    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(); 
    
    Check for a specific platform:

    PHP Code:
    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:

    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() 
    
    Attached Files
    Last edited by tkreturns; 12.09.12, 11:28.

    #2
    more about the script here php-mobile-detect - PHP class for mobile device detection - Google Project Hosting

    this is good in targetting specific traffic in conjuction with IP to location

    Comment


      #3
      Good script bro... Thanks for sharing!

      Comment


        #4
        nyc share.. tnx.

        Comment


          #5
          whats for use this?

          Originally posted by tkreturns View Post
          PHP SCRIPT TO DETECT MOBILE
          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(); 
          
          Check for a specific platform:

          PHP Code:
          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:

          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() 
          

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

          Comment


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

            Comment

            Working...
            X