Title: [Plugin: PHP Browser Detection] is_mobile() not working
Last modified: August 20, 2016

---

# [Plugin: PHP Browser Detection] is_mobile() not working

 *  Resolved [ykawato](https://wordpress.org/support/users/ykawato/)
 * (@ykawato)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-php-browser-detection-is_mobile-not-working/)
 * 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!
 * [http://wordpress.org/extend/plugins/php-browser-detection/](http://wordpress.org/extend/plugins/php-browser-detection/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [ransom1337](https://wordpress.org/support/users/ransom1337/)
 * (@ransom1337)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-php-browser-detection-is_mobile-not-working/#post-2686175)
 * This fix doesn’t work for me. Does anyone have any idea why, please?
 *  [Yukon Cornelius](https://wordpress.org/support/users/jimmmy/)
 * (@jimmmy)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-php-browser-detection-is_mobile-not-working/#post-2686177)
 * That fix didn’t work for me either. Actually, it broke things for ios user agent.
   [@ransom1337](https://wordpress.org/support/users/ransom1337/), did you manage
   to figure out a fix for detecting all mobile devices, or at least Android?
 *  [ransom1337](https://wordpress.org/support/users/ransom1337/)
 * (@ransom1337)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-php-browser-detection-is_mobile-not-working/#post-2686178)
 * Indeed I did!
 * I chose to use this plugin instead, it worked immediately:
    [http://wordpress.org/extend/plugins/mobile-client-detection-plugin/](http://wordpress.org/extend/plugins/mobile-client-detection-plugin/)
 * Hope that helps.
 *  [Yukon Cornelius](https://wordpress.org/support/users/jimmmy/)
 * (@jimmmy)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-php-browser-detection-is_mobile-not-working/#post-2686179)
 * Sweet. I’ll give that a try. Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: PHP Browser Detection] is_mobile() not working’ is closed to
new replies.

 * ![](https://ps.w.org/php-browser-detection/assets/icon-256x256.png?rev=999338)
 * [PHP Browser Detection](https://wordpress.org/plugins/php-browser-detection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-browser-detection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-browser-detection/)
 * [Active Topics](https://wordpress.org/support/plugin/php-browser-detection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-browser-detection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-browser-detection/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Yukon Cornelius](https://wordpress.org/support/users/jimmmy/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-php-browser-detection-is_mobile-not-working/#post-2686179)
 * Status: resolved