2017 © Pedro Peláez
 

library browser-detector

Detecting the user's browser, operating system and language.

image

sinergi/browser-detector

Detecting the user's browser, operating system and language.

  • Thursday, April 20, 2017
  • by sinergi
  • Repository
  • 58 Watchers
  • 423 Stars
  • 988,882 Installations
  • PHP
  • 28 Dependents
  • 2 Suggesters
  • 76 Forks
  • 10 Open issues
  • 32 Versions
  • 9 % Grown

The README.md

Browser Detector

Build Status StyleCI Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads License SensioLabsInsight Join the chat at https://gitter.im/sinergi/php-browser-detector, (*1)

Detecting the user's browser, operating system, device and language from PHP. Because browser detection is not always reliable and evolves at all time, use with care and feel free to contribute., (*2)

Requirements

This library uses PHP 5.3+., (*3)

Install

It is recommended that you install the PHP Browser library through composer. To do so, run the following command:, (*4)

composer require sinergi/browser-detector

Browser Detection

The Browser class allows you to detect a user's browser and version., (*5)

Browsers Detected

  • Vivaldi
  • Opera
  • Opera Mini
  • WebTV
  • Internet Explorer
  • Pocket Internet Explorer
  • Microsoft Edge
  • Konqueror
  • iCab
  • OmniWeb
  • Firebird
  • Firefox
  • Iceweasel
  • Shiretoko
  • Mozilla
  • Amaya
  • Lynx
  • Safari
  • Chrome
  • Navigator
  • GoogleBot
  • Yahoo! Slurp
  • W3C Validator
  • BlackBerry
  • IceCat
  • Nokia S60 OSS Browser
  • Nokia Browser
  • MSN Browser
  • MSN Bot
  • Netscape Navigator
  • Galeon
  • NetPositive
  • Phoenix
  • SeaMonkey
  • Yandex Browser
  • Comodo Dragon
  • Samsung Browser
  • wkhtmltopdf

Usage

use Sinergi\BrowserDetector\Browser;

$browser = new Browser();

if ($browser->getName() === Browser::IE && $browser->getVersion() < 11) {
    echo 'Please upgrade your browser.';
}

Compatibility Mode

Detect if Internet Explorer is in Compatibility Mode and send the correct header to have the browser render the page in its standard mode. This must be called before any output is sent to the browser., (*6)

use Sinergi\BrowserDetector\Browser;

$browser = new Browser();

if ($browser->getName() === Browser::IE && $browser->isCompatibilityMode()) {
    $browser->endCompatibilityMode();
}

OS Detection

The OS class allows you to detect a user's operating system and version., (*7)

OS Detected

  • Windows
  • Windows Phone
  • OS X
  • iOS
  • Android
  • Chrome OS
  • Linux
  • SymbOS
  • Nokia
  • BlackBerry
  • FreeBSD
  • OpenBSD
  • NetBSD
  • OpenSolaris
  • SunOS
  • OS2
  • BeOS

Usage

use Sinergi\BrowserDetector\Os;

$os = new Os();

if ($os->getName() === Os::IOS) {
    echo 'You are using an iOS device.';
}

Device Detection

The Device class allows you to detect a user's device., (*8)

Device Detected

  • iPad
  • iPhone
  • Windows Phone
  • Lumia

Usage

use Sinergi\BrowserDetector\Device;

$device = new Device();

if ($device->getName() === Device::IPAD) {
    echo 'You are using an iPad.';
}

Language Detection

The Language class allows you to detect a user's language., (*9)

Usage

use Sinergi\BrowserDetector\Language;

$language = new Language();

if ($language->getLanguage() === 'de') {
    echo 'Get this website in german.';
}

License

PHP Browser is licensed under The MIT License (MIT)., (*10)

The Versions

20/04 2017

7.0.0.x-dev

7.0.0.9999999-dev

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

12/04 2017

dev-feature/edge-version

dev-feature/edge-version

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

28/12 2016

dev-master

9999999-dev

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

28/12 2016

dev-develop

dev-develop

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

28/12 2016

6.1.2

6.1.2.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

13/12 2016

6.1.1

6.1.1.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

28/10 2016

6.1.0

6.1.0.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

28/07 2016

6.0.5

6.0.5.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

27/07 2016

6.0.4

6.0.4.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

25/07 2016

6.0.3

6.0.3.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

30/06 2016

6.0.2

6.0.2.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

09/04 2016

6.0.1

6.0.1.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

18/01 2016

6.0.0

6.0.0.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0

 

The Development Requires

language browser os detection operating system

08/01 2016

5.1.2

5.1.2.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

language browser os detection operating system

08/12 2015

5.1.1

5.1.1.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

language browser os detection operating system

16/11 2015

5.1.0

5.1.0.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

language browser os detection operating system

10/11 2015

5.0.2

5.0.2.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

language browser os detection operating system

16/09 2015

5.0.1

5.0.1.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

language browser os detection operating system

08/09 2015

5.0.0

5.0.0.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

language browser os detection operating system

08/09 2015

4.0.1

4.0.1.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

language browser os detection operating system

22/08 2015

4.0.0

4.0.0.0

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

language browser os detection operating system

23/05 2015

3.1.4

3.1.4.0 https://github.com/gabrielbull/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

language browser os detection operating system

17/04 2015

3.1.3

3.1.3.0 https://github.com/gabrielbull/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

language browser os detection operating system

03/12 2014

3.1.2

3.1.2.0 https://github.com/gabrielbull/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

language browser os detection operating system

29/08 2014

3.1.1

3.1.1.0 https://github.com/gabrielbull/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

language browser os detection operating system

29/08 2014

3.1.0

3.1.0.0 https://github.com/gabrielbull/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

language browser os detection operating system

21/05 2014

3.0.1

3.0.1.0 https://github.com/gabrielbull/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

language browser os detection operating system

09/03 2014

3.0.0

3.0.0.0 https://github.com/gabrielbull/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

language browser os detection operating system

09/03 2014

2.2.0

2.2.0.0 https://github.com/gabrielbull/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

language browser os detection operating system

12/08 2013

2.1.0

2.1.0.0 https://github.com/gavroche/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3

 

language browser os detection operating system

27/03 2013

2.0.1

2.0.1.0 https://github.com/gavroche/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3

 

language browser os detection operating system

19/03 2013

2.0.0

2.0.0.0 https://github.com/gavroche/php-browser

Detecting the user's browser, operating system and language.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3

 

language browser os detection operating system