Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.
/ Fam Public archive

Fam UserAgentParser is a lightweight and fast browser detector. It determines the operating system, web client name, and web client version.

License

Notifications You must be signed in to change notification settings

dspasic/Fam

Repository files navigation

Fam UserAgentParser

Fam UserAgentParser is a lightweight and fast browser detector. It determines the operating system, web client name and web client version.


Scrutinizer Code Quality build status for Fam Code Coverage


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';
}

About

Fam UserAgentParser is a lightweight and fast browser detector. It determines the operating system, web client name, and web client version.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages