catcoder/mobiledetectlib

Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

2.8.22 2016-04-24 09:47 UTC

README

Build Status Latest Stable Version Total Downloads Daily Downloads License ![Gitter](https://badges.gitter.im/Join Chat.svg)

Mobile Detect

Motto: "Every business should have a mobile detection script to detect mobile readers."

Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

We're committed to make Mobile_Detect the best open-source mobile detection resource and this is why before each release we're running unit tests, we also research and update the detection rules on daily and weekly basis.

Your website's content strategy is important! You need a complete toolkit to deliver an experience that is optimized, fast and relevant to your users. Mobile_Detect class is a server-side detection tool that can help you with your RWD strategy, it is not a replacement for CSS3 media queries or other forms of client-side feature detection.

Announcements

For 2.x branch we are no longer taking optimizations pull requests, but only new regexes and User-Agents for our tests. On 2.x releases we are focusing on new tablets only. All the pull requests about TVs, bots or optimizations will be closed and analyzed after 3.0.0-beta is released.

Still working on 3.0.0 branch to provide you with device detection! We're really excited on this one! We would like to speed this up, but life and family gets in the way ;)

Special thanks to JetBrains for providing licenses for PHPStorm. In case you never heard or tried PHPStorm, you're clearly missing out! Check PHPStorm out!

Download and demo

Continuous updates

You can use composer in your release and update process to make sure you have the latest Mobile_Detect version.

composer require mobiledetect/mobiledetectlib
{
    "require": {
        "mobiledetect/mobiledetectlib": "^2.8"
    }
}
Help

I'm currently paying for hosting and spend a lot of my family time to maintain the project and planning the future releases. I would highly appreciate any money donations that will keep the research going.

Special thanks to the community 👍 for donations, BrowserStack - for providing access to their great platform, Zend - for donating licenses, Dragos Gavrila who contributed with the logo.

3rd party modules / [Submit new](../../issues/new?title=New%203rd%20party%20module&body=Name, Link and Description of the module.)

👉 Keep Mobile_Detect.php class in a separate module and do NOT include it in your script core because of the high frequency of updates. :point_right: When including the class into you web application or module always use include_once '../path/to/Mobile_Detect.php to prevent conflicts.