PHP Browser Detection
[resolved] is_mobile() not working (5 posts)

  1. ykawato
    Posted 4 years ago #

    Hi, I am using is_mobile() and wasn't working so I did the following to make it work.

    Taking a look at the source code, line 238

    if(isset($browserInfo['ismobiledevice']) && $browserInfo['ismobiledevice']==1)

    changed it to

    if(isset($browserInfo['ismobiledevice']) && $browserInfo['ismobiledevice']=='true')

    and now it detects successfully.

    It's a very simple and great plugin. Thanks!


  2. ransom1337
    Posted 3 years ago #

    This fix doesn't work for me. Does anyone have any idea why, please?

  3. Yukon Cornelius
    Posted 3 years ago #

    That fix didn't work for me either. Actually, it broke things for ios user agent. @Ransom1337, did you manage to figure out a fix for detecting all mobile devices, or at least Android?

  4. ransom1337
    Posted 3 years ago #

    Indeed I did!

    I chose to use this plugin instead, it worked immediately:

    Hope that helps.

  5. Yukon Cornelius
    Posted 3 years ago #

    Sweet. I'll give that a try. Cheers!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • PHP Browser Detection
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic