Domain Rating
by Ahrefs
Domain Rating by Ahrefs53
Description
PHP User Agent Parser is a small PHP library that reads a browser's HTTP_USER_AGENT string and returns the platform, the browser and the browser version. The code is minimalist and fast, and it works with PHP 5.4 or newer. You can call it as a simple procedural function, or use the object-oriented UserAgentParser class with methods for platform, browser and browser version. The library is on GitHub and through Composer. The author's site has a demo where you can paste a user agent string and see what it detects, and a list of the platforms and browsers the parser recognizes. The article was first posted in 2011 and updated in 2022, and the comments on the page include requests for platform version and processor details. It is intended for PHP developers who need to tell devices and browsers apart in their server-side code.…
Highlights
- Reads platform, browser and browser version from a user agent
- Procedural function or object-oriented parser
- Minimalist code that runs on PHP 5.4 or newer
- Installable with Composer
- Demo page to test any user agent string
- List of detected platforms and browsers
Ratings & Reviews
No ratings yet
Be the first to rate PhpUserAgent.
People also visit
PhpUserAgent FAQ
What does it do?
It reads a user agent string and returns the platform, the browser and the browser version.
What do I need?
PHP 5.4.0 or newer, according to the page.
How do I install it?
Run composer require donatj/phpuseragentparser, or download the script from GitHub.
How do I use it?
Call parse_user_agent() for the procedural form, or create a UserAgentParser object and call parse() or use it as a function.
Is it free?
Yes. The script is open source and available on GitHub.
What are the best PhpUserAgent alternatives?
Popular alternatives to PhpUserAgent include Uap PHP, Browser.php and Bowser. See all PhpUserAgent alternatives
