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.
Requires
- php: >=5.0.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- johnkary/phpunit-speedtrap: ~1.0@dev
- phpunit/phpunit: *
- dev-master
- 2.8.22
- 2.8.21
- 2.8.20
- 2.8.19
- 2.8.18
- 2.8.17
- 2.8.16
- 2.8.15
- 2.8.14
- 2.8.13
- 2.8.12
- 2.8.11
- 2.8.10
- 2.8.8
- 2.8.7
- 2.8.6
- 2.8.5
- 2.8.4
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.9
- 2.5.8
- 2.5.7
- 2.5.6
- 2.5.5
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.0
- dev-devel
- dev-devel-3-workinprogress
- dev-devel-3
- dev-jsonify
This package is not auto-updated.
Last update: 2024-11-09 20:17:37 UTC
README
![Gitter](https://badges.gitter.im/Join Chat.svg)
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.