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

ActiveLibrary

sgrodzicki/phpbrowscap
======================

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

0754PHP

Since Nov 6Pushed 13y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)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/66bf48ef6cca34eafb169eb9c8be6bd97dfe54188ade3a26373ab1aa3ea8d6dc/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7367726f647a69636b692f70687062726f77736361702e706e67)](http://travis-ci.org/sgrodzicki/phpbrowscap)

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

[](#introduction)

The [browscap.ini](http://browsers.garykeith.com/downloads.asp) file is a database maintained by [Gary Keith](http://browsers.garykeith.com/) which provides a lot of details about browsers and their capabilities, such as name, versions, Javascript support and so on.

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.

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-exaustive feature list of the Browscap class:

- Fast
- Standalone
- Even faster parsing many user agents
- Fully get\_browser() compatible
- Often faster and more accurate than get\_browser()
- Fully PHP configuration independent
- User agent auto-detection
- Returns object or array
- Parsed .ini file cached directly into PHP arrays
- Accepts any .ini file (even ASP and lite versions)
- Auto updated browscap.ini file and cache from remote server with version checking
- Configurable remote update server
- Fully configurable (since 0.2)
- PHP4 and PHP &gt;=5.3 compatible (PHP &lt;5.3 version deprecated)
- 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 note that the browscap class only parses and queries the browscap.ini database provided by Gary Keith. If a browser is wrongly identified or a results presents erroneous properties, please refer directly to the browscap project homepage at:

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1870a906f7e873d023a0379a3664da1073d97a89d36e6f1b4cbe6a6fd49aada6?d=identicon)[sgrodzicki](/maintainers/sgrodzicki)

---

Top Contributors

[![GaretJax](https://avatars.githubusercontent.com/u/86236?v=4)](https://github.com/GaretJax "GaretJax (19 commits)")[![DominikTo](https://avatars.githubusercontent.com/u/1384635?v=4)](https://github.com/DominikTo "DominikTo (5 commits)")[![sgrodzicki](https://avatars.githubusercontent.com/u/712836?v=4)](https://github.com/sgrodzicki "sgrodzicki (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)")[![erunion](https://avatars.githubusercontent.com/u/33762?v=4)](https://github.com/erunion "erunion (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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