README

Mobile Detect

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

Build Status Latest Stable Version Total Downloads Daily Downloads License

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
Download Docs Examples
Go to releases Become a contributor Code examples
Mobile_Detect.php History :iphone: Live demo!
Composer package

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

json { "require": { "mobiledetect/mobiledetectlib": "^2.8" } }

Help
Pledgie Paypal
Donate :+1: Donate :beer:

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 :+1: 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

:point_right: 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.

JavaScript

Varnish Cache

LUA

PHP

WordPress

Drupal

Joomla

Magento

PrestaShop

Laravel

Zend Framework

Symfony

Slim Framework

ExpressionEngine

Yii Framework

CakePHP

FuelPHP

TYPO3

Other

Perl

Python

Ruby

Go

LUA