PHPackages                             sb15/phpbrowscap - 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. sb15/phpbrowscap

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

sb15/phpbrowscap
================

Standalone replacement for php's native get\_browser() function

2.0.1(11y ago)0684MIT LicensePHPPHP &gt;=5.3.0

Since Aug 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sb15/phpbrowscap)[ Packagist](https://packagist.org/packages/sb15/phpbrowscap)[ Docs](http://github.com/GaretJax/phpbrowscap)[ RSS](/packages/sb15-phpbrowscap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (5)Used By (0)

Browser Capabilities PHP Project
================================

[](#browser-capabilities-php-project)

*Hacking around with PHP to have a better solution than `get_browser()`*

[![Build Status](https://camo.githubusercontent.com/f66983b4348a81478bbc20fb2011a6ad70a5a5eb579154540a9d3bef30c1f9e5/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f47617265744a61782f70687062726f77736361702e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/GaretJax/phpbrowscap)

Changes (new version - 2.0)
---------------------------

[](#changes-new-version---20)

Please see [changelog](CHANGELOG.md) for a list of recent changes. (huge performance improvements!)

Introduction
------------

[](#introduction)

The [browscap.ini](http://tempdownloads.browserscap.com/) file is a database which provides a lot of details about browsers and their capabilities, such as name, versions, Javascript support and so on.

*Please note: [browscap.ini](http://tempdownloads.browserscap.com/) was maintained by [Gary Keith](https://github.com/GaryKeith) and is now maintained by [RAD Moose](https://github.com/radmoose). More information about the transfer of owners can be found [here](https://groups.google.com/forum/#!topic/browscap/pk_dkkqdXzg). Browscap.ini source files are currently available at a temporary location (). All the links in `Browscap` class are updated, but if you use custom links remember to change them!*

PHP's native [get\_browser()](http://php.net/get_browser) function parses this file and provides you with a complete set of information about every browser's details, But it requires the path to the browscap.ini file to be specified in the php.ini [browscap](http://ch2.php.net/manual/en/ref.misc.php#ini.browscap)directive which is flagged as `PHP_INI_SYSTEM`.

Since in most shared hosting environments you have not access to the php.ini file, the browscap directive cannot be modified and you are stuck with either and outdated database or without browscap support at all.

Browscap is a standalone class for PHP &gt;=5.3 that gets around the limitations of `get_browser()` and manages the whole thing. It offers methods to update, cache, adapt and get details about every supplied user agent on a standalone basis. It's also much faster than `get_browser()` while still returning the same results.

Browscap is a [Composer](http://packagist.org/about-composer) package.

Quick start
-----------

[](#quick-start)

A quick start guide is available on the GitHub wiki, at the following address:

Features
--------

[](#features)

Here is a non-exhaustive feature list of the Browscap class:

- Very fast
    - at least 3 times faster than get\_browser() when not using opcache
    - **20 or more** times faster than get\_browser() when using opcache ([see tests](https://github.com/quentin389/ua-speed-tests))
- Standalone and fully PHP configuration independent (no need for php.ini setting)
- Fully get\_browser() compatible (with some get\_browser() bugs fixed)
- User agent auto-detection
- Returns object or array
- Parsed .ini file cached directly into PHP arrays (leverages opcache)
- Accepts any .ini file (even ASP and lite versions)
- Auto updated browscap.ini file and cache from remote server with version checking
- Fully configurable, including configurable remote update server and update schedules
- `PHP >= 5.3` compatible
- Released under the MIT License

Issues and feature requests
---------------------------

[](#issues-and-feature-requests)

Please report your issues and ask for new features on the GitHub Issue Tracker at

Please report incorrectly identified User Agents and browser detect in the browscap.ini file on Google Groups here:

Please note that the Browscap class only parses and queries the browscap.ini database provided by RAD Moose (previously by Gary Keith). If a browser is wrongly identified or a results presents erroneous properties, please refer directly to the temporary browscap project homepage at:  or post your misidentified browser and User Agent at the Browscap Google Groups page:

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~201 days

Total

4

Last Release

4053d ago

Major Versions

1.0 → 2.0b2013-08-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/c023eaab6cc1be8c58dc45e3dbc3e03997afc0d8f3d05464a7aea4fef6d40cef?d=identicon)[alexander.perov](/maintainers/alexander.perov)

---

Top Contributors

[![GaretJax](https://avatars.githubusercontent.com/u/86236?v=4)](https://github.com/GaretJax "GaretJax (20 commits)")[![quentin389](https://avatars.githubusercontent.com/u/2136749?v=4)](https://github.com/quentin389 "quentin389 (12 commits)")[![DominikTo](https://avatars.githubusercontent.com/u/1384635?v=4)](https://github.com/DominikTo "DominikTo (5 commits)")[![vitorbrandao](https://avatars.githubusercontent.com/u/109226?v=4)](https://github.com/vitorbrandao "vitorbrandao (4 commits)")[![jonathaningram](https://avatars.githubusercontent.com/u/626664?v=4)](https://github.com/jonathaningram "jonathaningram (3 commits)")[![sb15](https://avatars.githubusercontent.com/u/517618?v=4)](https://github.com/sb15 "sb15 (3 commits)")[![erunion](https://avatars.githubusercontent.com/u/33762?v=4)](https://github.com/erunion "erunion (1 commits)")[![DaAwesomeP](https://avatars.githubusercontent.com/u/4472083?v=4)](https://github.com/DaAwesomeP "DaAwesomeP (1 commits)")[![amiri27](https://avatars.githubusercontent.com/u/1594140?v=4)](https://github.com/amiri27 "amiri27 (1 commits)")

---

Tags

browseruser agentget\_browsercapabilities

### Embed Badge

![Health badge](/badges/sb15-phpbrowscap/health.svg)

```
[![Health](https://phpackages.com/badges/sb15-phpbrowscap/health.svg)](https://phpackages.com/packages/sb15-phpbrowscap)
```

###  Alternatives

[jenssegers/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

4.8k67.8M440](/packages/jenssegers-agent)[garetjax/phpbrowscap

Standalone replacement for php's native get\_browser() function

437862.4k5](/packages/garetjax-phpbrowscap)[hisorange/browser-detect

Browser &amp; Mobile detection package for Laravel.

1.1k10.1M50](/packages/hisorange-browser-detect)[browscap/browscap-php

Standalone replacement for php's native get\_browser() function

4413.8M22](/packages/browscap-browscap-php)[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.

5876.7M19](/packages/cbschuld-browserphp)[foroco/php-browser-detection

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

1554.7M7](/packages/foroco-php-browser-detection)

PHPackages © 2026

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