PHPackages                             sail/useragent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sail/useragent

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sail/useragent
==============

Library to detect the browser and all its info (OS, Platform, ...)

1.0.0-alpha2(13y ago)282.7k9[1 issues](https://github.com/rainphp/useragent/issues)[2 PRs](https://github.com/rainphp/useragent/pulls)MITPHPPHP &gt;=5.3.0

Since Apr 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/rainphp/useragent)[ Packagist](https://packagist.org/packages/sail/useragent)[ Docs](http://github.com/rainphp/useragent)[ RSS](/packages/sail-useragent/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (6)Used By (0)

Sail\\Useragent
===============

[](#sailuseragent)

This Library detect the browser and all its informations, such as the browser name and version, the OS and the platform. It uses Dependency Injection to load a Parser library, so you can choose the level of details you need from the detection.

Parser
------

[](#parser)

- **Parser\\Simple**, it detects the common browsers (Chrome, Safari, Firefox, MSIE), the basic OS (OS X, iOS, Windows, Linux), it detects the device (iPhone,iPad,Android Phone) and the type of useragent (browser, mobile browser, mailer, spider).
- **Parser\\UAS**, it detects all the browser listed in  using the UAS PHP Api.
- **Parser\\Quick** (in progress), it detect the browser name and the device computer, iphone, ipad, generic mobile.

Quick Start
-----------

[](#quick-start)

Install with composer:

```
{
    "require": {
        "sail/useragent": "dev-master"
    }
}
```

create an index.php file:

```
