serbanghita/Mobile-Detect

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.

PHP

10,677

958 commits

updated Aug 11, 2026

See the code

README

Mobile Detect

MobileDetect, PHP mobile detection class

Build status Latest stable version Latest tag Monthly Downloads Total Downloads MIT 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.

Before you install

MobileDetect is maintained on one rolling branch per major line. Tags follow the pattern <major>.<minor>.<patch> and always live on the matching branch.

VersionTestsNamespaceBranchPHP VersionPurpose
2.*2.x tests\Mobile_Detect2.x>=5.6,<7.0Deprecated
3.*3.x testsDetection\MobileDetect3.x>=7.4,<8.0LTS
4.*4.x testsDetection\MobileDetect4.x>=8.2 (since 4.10.0, previously >=8.0)Current, Recommended

🤝 Supporting

If you are using Mobile Detect open-source package in your production apps, in presentation demos, hobby projects, school projects or so, you can sponsor my work by donating a small amount 👍.

I'm currently paying for domains, 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.

Special thanks to:

  • the community 👍 for donations, submitting patches and issues
  • Gitbook team for the open-source license for their technical documentation tool.

📃 Documentation

The entire documentation is available on Gitbook: https://docs.mobiledetect.net

👾 Demo

Point your device to: https://demo.mobiledetect.net

🐛 Testing

vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-html .coverage

🤝 Contributing

Please see the Contribute guide for details.

🔒 Security

If you discover any security related issues, please email serbanghita@gmail.com instead of using the issue tracker.

🎉 Credits

device-detection
mobile-detect
mobile-redirects
php
user-agents

serbanghita/Mobile-Detect

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.

PHP

10,677

958 commits

updated Aug 11, 2026

See the code

README

Mobile Detect

MobileDetect, PHP mobile detection class

Build status Latest stable version Latest tag Monthly Downloads Total Downloads MIT 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.

Before you install

MobileDetect is maintained on one rolling branch per major line. Tags follow the pattern <major>.<minor>.<patch> and always live on the matching branch.

VersionTestsNamespaceBranchPHP VersionPurpose
2.*2.x tests\Mobile_Detect2.x>=5.6,<7.0Deprecated
3.*3.x testsDetection\MobileDetect3.x>=7.4,<8.0LTS
4.*4.x testsDetection\MobileDetect4.x>=8.2 (since 4.10.0, previously >=8.0)Current, Recommended

🤝 Supporting

If you are using Mobile Detect open-source package in your production apps, in presentation demos, hobby projects, school projects or so, you can sponsor my work by donating a small amount 👍.

I'm currently paying for domains, 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.

Special thanks to:

  • the community 👍 for donations, submitting patches and issues
  • Gitbook team for the open-source license for their technical documentation tool.

📃 Documentation

The entire documentation is available on Gitbook: https://docs.mobiledetect.net

👾 Demo

Point your device to: https://demo.mobiledetect.net

🐛 Testing

vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-html .coverage

🤝 Contributing

Please see the Contribute guide for details.

🔒 Security

If you discover any security related issues, please email serbanghita@gmail.com instead of using the issue tracker.

🎉 Credits

device-detection
mobile-detect
mobile-redirects
php
user-agents

Project health

Overall

2.3/10

Maintained

0/10

Code review

1/10
OpenSSF Scorecard

Significant stargazers

Kévin Dunglas

4,629 followers · starred Oct 2014

Daniel Polito

109 followers · starred Aug 2012

Marin Atanasov

274 followers · starred Dec 2015

Graham F. Scott

35 followers · starred Mar 2013