PHPackages                             supportpal/accept-language-parser - 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. supportpal/accept-language-parser

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

supportpal/accept-language-parser
=================================

An alternative to ext-intl's locale\_accept\_from\_http function.

v0.2.1(3y ago)043.6k—4%2MITPHPPHP &gt;=5.3.0

Since Feb 2Pushed 1y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (5)Used By (2)

 [![](https://camo.githubusercontent.com/568702860ea73eac69fe2ea233579b2b0ecf0e4a48e1da777f22a21b1fcb353f/68747470733a2f2f7777772e737570706f727470616c2e636f6d2f6173736574732f696d672f6c6f676f5f626c75655f736d616c6c2e706e67)](https://www.supportpal.com)
 A PHP port of [npm:accept-language-parser](https://github.com/opentable/accept-language-parser) and an equivalent to the ext-intl locale\_accept\_from\_http function.

[![Build Status](https://github.com/supportpal/accept-language-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/supportpal/accept-language-parser/actions)[![Total Downloads](https://camo.githubusercontent.com/7b2d2551a510abeb27cdeaf854f5c94f422a27aa0b97ca53005d6cc2ea42a608/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737570706f727470616c2f6163636570742d6c616e67756167652d706172736572)](https://packagist.org/packages/supportpal/accept-language-parser)[![Latest Stable Version](https://camo.githubusercontent.com/0eaa98db5b01b9610b74d217539e6f30197c7738d0ffa70243fb2d5333eec9bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737570706f727470616c2f6163636570742d6c616e67756167652d706172736572)](https://packagist.org/packages/supportpal/accept-language-parser)[![License](https://camo.githubusercontent.com/41d071179247ecceca8e02cdc21798cf6419ba2e28af9d18c624d3c3400e6a91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737570706f727470616c2f6163636570742d6c616e67756167652d706172736572)](https://packagist.org/packages/supportpal/accept-language-parser)

---

Install
=======

[](#install)

```
composer require supportpal/accept-language-parser
```

Usage
=====

[](#usage)

Parse
-----

[](#parse)

Parses an ACCEPT\_LANGUAGE header and returns all parsed locales.

```
$parser = new \SupportPal\AcceptLanguageParser\Parser($_SERVER['http_accept_language']);
foreach ($parser->parse() as $component) {
    echo $component->code();
}
```

Pick
----

[](#pick)

Parses an ACCEPT\_LANGUAGE header and returns only locales which match those requested.

```
$parser = new \SupportPal\AcceptLanguageParser\Parser('en-GB;q=0.8');
foreach ($parser->pick(array('en')) as $component) {
    echo $component->code();
}
```

License
=======

[](#license)

This package is licensed under the [MIT License](https://github.com/supportpal/accept-language-parser/blob/master/LICENSE).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

Every ~159 days

Total

4

Last Release

1452d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/809d7ed0e9aa913afb9147041cb2e94ff4571d0227569e2ba315d1550e3eefa7?d=identicon)[bytestream](/maintainers/bytestream)

---

Top Contributors

[![bytestream](https://avatars.githubusercontent.com/u/1788397?v=4)](https://github.com/bytestream "bytestream (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/supportpal-accept-language-parser/health.svg)

```
[![Health](https://phpackages.com/badges/supportpal-accept-language-parser/health.svg)](https://phpackages.com/packages/supportpal-accept-language-parser)
```

###  Alternatives

[event-engine/php-engine

CQRS / ES PHP SDK for event-engine.io

5436.1k2](/packages/event-engine-php-engine)

PHPackages © 2026

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