PHPackages                             kevinkl3/browser-detector - 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. kevinkl3/browser-detector

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

kevinkl3/browser-detector
=========================

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

6.1.5(6mo ago)02MITPHPPHP &gt;=8.4CI failing

Since Dec 29Pushed 6mo agoCompare

[ Source](https://github.com/kevinkl3/php-browser-detector)[ Packagist](https://packagist.org/packages/kevinkl3/browser-detector)[ RSS](/packages/kevinkl3-browser-detector/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

Browser Detector
================

[](#browser-detector)

> **Note:** This is a fork of the original repository [sinergi/php-browser-detector](https://github.com/sinergi/php-browser-detector) with added PHP 8.4+ support.

[![Build Status](https://camo.githubusercontent.com/b85453fb38d943d9c13e1ca5667fe5642655d4e08049d133bf3a0eb389863a50/68747470733a2f2f7472617669732d63692e6f72672f73696e657267692f7068702d62726f777365722d6465746563746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sinergi/php-browser-detector)[![StyleCI](https://camo.githubusercontent.com/97e4bdee12f1be5100225298b7aacf190b98c0672b65544a79d7ca3d324a0cd1/68747470733a2f2f7374796c6563692e696f2f7265706f732f333735323435332f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/3752453)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/67e615dc586db8ba36254c3939830a7f4db9574a4de665bde3973fdc41ed9a4d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73696e657267692f7068702d62726f777365722d6465746563746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sinergi/php-browser-detector/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c5410bf3602dab129553abce3fd030907a731c4d3f52461400a77ef76df552e7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73696e657267692f7068702d62726f777365722d6465746563746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sinergi/php-browser-detector/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/17c6f295a146d9c6cf5b0333ad7fb2c0cd06a68c919768cb163bbbdbc0a1762d/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e657267692f62726f777365722d6465746563746f722e7376673f7374796c653d666c6174)](https://packagist.org/packages/sinergi/browser-detector)[![Total Downloads](https://camo.githubusercontent.com/50aef64c92e7b1941340888fd08632ffbbb8dc975512a775017c039e652c2f0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73696e657267692f62726f777365722d6465746563746f722e7376673f7374796c653d666c6174)](https://packagist.org/packages/sinergi/browser-detector)[![License](https://camo.githubusercontent.com/7280e8c1ef1dec7c308a4d977515388b3f94f0a982bf2bf9b26b975cd1821227/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73696e657267692f62726f777365722d6465746563746f722e7376673f7374796c653d666c6174)](https://packagist.org/packages/sinergi/browser-detector)[![SensioLabsInsight](https://camo.githubusercontent.com/a2ba4e71ae821bbb6256ed7b685233cde04feabf5c369c095523ef668a93e5aa/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31383635613032652d323834632d343238612d613262342d3039316339393765353933352f6d696e692e706e67)](https://insight.sensiolabs.com/projects/1865a02e-284c-428a-a2b4-091c997e5935)[![Join the chat at https://gitter.im/sinergi/php-browser-detector](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/sinergi/php-browser-detector?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

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.

Requirements
------------

[](#requirements)

This library uses PHP 5.3+. This fork adds support for PHP 8.4+.

Install
-------

[](#install)

It is recommended that you install the PHP Browser library [through composer](http://getcomposer.org). To do so, run the following command:

```
composer require kevinkl3/browser-detector
```

Browser Detection
-----------------

[](#browser-detection)

The Browser class allows you to detect a user's browser and version.

### Browsers Detected

[](#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

[](#usage)

```
use Sinergi\BrowserDetector\Browser;

$browser = new Browser();

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

#### Compatibility Mode

[](#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.

```
use Sinergi\BrowserDetector\Browser;

$browser = new Browser();

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

OS Detection
------------

[](#os-detection)

The OS class allows you to detect a user's operating system and version.

### OS Detected

[](#os-detected)

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

### Usage

[](#usage-1)

```
use Sinergi\BrowserDetector\Os;

$os = new Os();

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

Device Detection
----------------

[](#device-detection)

The Device class allows you to detect a user's device.

### Device Detected

[](#device-detected)

- iPad
- iPhone
- Windows Phone
- Lumia

### Usage

[](#usage-2)

```
use Sinergi\BrowserDetector\Device;

$device = new Device();

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

Language Detection
------------------

[](#language-detection)

The Language class allows you to detect a user's language.

### Usage

[](#usage-3)

```
use Sinergi\BrowserDetector\Language;

$language = new Language();

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

License
-------

[](#license)

PHP Browser is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance68

Regular maintenance activity

Popularity2

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

186d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a4d635b31fdcc426ef3bdc093be9f5a8f5feca36814cd1c7ab4adde7a7b1e261?d=identicon)[kevinkl3](/maintainers/kevinkl3)

---

Top Contributors

[![gabrielbull](https://avatars.githubusercontent.com/u/671923?v=4)](https://github.com/gabrielbull "gabrielbull (117 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (26 commits)")[![iGusev](https://avatars.githubusercontent.com/u/1555767?v=4)](https://github.com/iGusev "iGusev (21 commits)")[![coreywynsma](https://avatars.githubusercontent.com/u/929045?v=4)](https://github.com/coreywynsma "coreywynsma (5 commits)")[![janhohner](https://avatars.githubusercontent.com/u/649895?v=4)](https://github.com/janhohner "janhohner (3 commits)")[![kevinkl3](https://avatars.githubusercontent.com/u/3175119?v=4)](https://github.com/kevinkl3 "kevinkl3 (3 commits)")[![yigit-serin](https://avatars.githubusercontent.com/u/20225497?v=4)](https://github.com/yigit-serin "yigit-serin (2 commits)")[![maxcoe](https://avatars.githubusercontent.com/u/44701746?v=4)](https://github.com/maxcoe "maxcoe (2 commits)")[![pavarnos](https://avatars.githubusercontent.com/u/589595?v=4)](https://github.com/pavarnos "pavarnos (2 commits)")[![jonasschumacher](https://avatars.githubusercontent.com/u/8958534?v=4)](https://github.com/jonasschumacher "jonasschumacher (1 commits)")[![asdfklgash](https://avatars.githubusercontent.com/u/3726443?v=4)](https://github.com/asdfklgash "asdfklgash (1 commits)")[![blackbass1988](https://avatars.githubusercontent.com/u/1463891?v=4)](https://github.com/blackbass1988 "blackbass1988 (1 commits)")[![cbulock](https://avatars.githubusercontent.com/u/176519?v=4)](https://github.com/cbulock "cbulock (1 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")[![adlenton](https://avatars.githubusercontent.com/u/20105978?v=4)](https://github.com/adlenton "adlenton (1 commits)")[![martin-song-ck](https://avatars.githubusercontent.com/u/7536054?v=4)](https://github.com/martin-song-ck "martin-song-ck (1 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (1 commits)")[![tigrazone](https://avatars.githubusercontent.com/u/3808839?v=4)](https://github.com/tigrazone "tigrazone (1 commits)")

---

Tags

browserlanguagedetectionosoperating system

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kevinkl3-browser-detector/health.svg)

```
[![Health](https://phpackages.com/badges/kevinkl3-browser-detector/health.svg)](https://phpackages.com/packages/kevinkl3-browser-detector)
```

###  Alternatives

[patrickschur/language-detection

A language detection library for PHP. Detects the language from a given text string.

8603.6M21](/packages/patrickschur-language-detection)[cbschuld/browser.php

A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.

5837.1M28](/packages/cbschuld-browserphp)[thadafinser/user-agent-parser

UserAgent parsing done right http://useragent.mkf.solutions/

246317.3k2](/packages/thadafinser-user-agent-parser)[foroco/php-browser-detection

Ultra fast PHP library to detect browser, OS, platform and device type by User-Agent parsing

1545.5M7](/packages/foroco-php-browser-detection)[tivie/php-os-detector

A small utility library that detects the OS the server is running on

221.6M13](/packages/tivie-php-os-detector)[unicodeveloper/laravel-identify

A Laravel 5 Package Provider to Identify/detect a user's browser, device, operating system and Language

19422.0k](/packages/unicodeveloper-laravel-identify)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
