fam / util-useragentparser
This package is abandoned and no longer maintained.
No replacement package was suggested.
dev-master
2017-04-20 20:29 UTC
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is not auto-updated.
Last update: 2022-12-02 11:35:22 UTC
README
Fam UserAgentParser is a lightweight and fast browser detector. It determines the operating system, web client name and web client version.
Installing
You can install Fam UserAgentParser with composer. To install Fam UserAgentParser with composer just execute the following command:
composer require fam/util-useragentparser
Getting started
$userAgent = UserAgentParser::createInstance()->parseUserAgent($_SERVER['HTTP_USER_AGENT']); if ($userAgent->isWebClient('firefox')) { if ($userAgent->isWebClientVersionBetween(9.5, 9.6)) { echo 'firefox between 95 and 96'; } else if ($userAgent->isWebClientVersionBetween(9.2, 9.4)) { echo 'firefox between 92 and 94'; } } if ($userAgent->isOs('macintosh')) { echo 'Mac'; }