PHPackages                             zonuexe/http-accept-language - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. zonuexe/http-accept-language

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

zonuexe/http-accept-language
============================

HTTP Accept-Language Header parser

0.6.0(3y ago)201.2M↓49.7%9[1 PRs](https://github.com/BaguettePHP/http-accept-language/pulls)8MITPHPPHP &gt;=7.2.0

Since Aug 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/BaguettePHP/http-accept-language)[ Packagist](https://packagist.org/packages/zonuexe/http-accept-language)[ RSS](/packages/zonuexe-http-accept-language/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (3)Versions (7)Used By (8)

HTTP Accept-Language
====================

[](#http-accept-language)

[![Package version](https://camo.githubusercontent.com/760b1a84d81bbb9d1c00caae83db3a5c36b0216102bb90673354f698102e8375/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a6f6e756578652f687474702d6163636570742d6c616e67756167652e7376673f7374796c653d666c6174)](https://packagist.org/packages/zonuexe/http-accept-language)[![Build Status](https://github.com/BaguettePHP/http-accept-language/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/BaguettePHP/http-accept-language/actions)[![Downloads this Month](https://camo.githubusercontent.com/f9a5d150d10d8eb47b36a0090c66b2e49eb522fedd48397b9b37eb39135f2b33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f7a6f6e756578652f687474702d6163636570742d6c616e67756167652e737667)](https://packagist.org/packages/zonuexe/http-accept-language)

`Teto\HTTP\AcceptLanguage` is HTTP `Accept-Language` header parser based on PHP [`Locale`](https://www.php.net/Locale) module.

Future scope
------------

[](#future-scope)

This package was designed ten years ago and is considered legacy due to its global dependencies. Over time I will provide a new package as part of the [Hakone](https://github.com/hakonephp) project.

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

[](#requirements)

- PHP (7.2+)
    - `ext/intl`

Installation
------------

[](#installation)

```
composer require zonuexe/http-accept-language

```

Usage
-----

[](#usage)

see `tests/public/greeting.php`.

API
---

[](#api)

- `Teto\HTTP\AcceptLanguage::detect()`
- `Teto\HTTP\AcceptLanguage::get()`
- `Teto\HTTP\AcceptLanguage::getLanguages()`
- `Teto\HTTP\AcceptLanguage::parse()`

Features
--------

[](#features)

- Accepts `*`(wildcard) tag
    - `*-Hant-*` → `{language: '*', script: 'Hant'}`
    - `zh-*-TW` → `{language: 'zh', region: 'TW'}`

Reference
---------

[](#reference)

- [RFC 9110 - HTTP Semantics #12.5.4. Accept-Language](https://www.rfc-editor.org/rfc/rfc9110.html#name-accept-language)
- [RFC 4647 - Matching of Language Tags](https://datatracker.ietf.org/doc/html/rfc4647)
- [RFC 5646 - Tags for Identifying Languages](https://datatracker.ietf.org/doc/html/rfc5646)

Copyright
---------

[](#copyright)

> **HTTP Accept-Language header parser for PHP**
>
> Copyright (c) 2016 Baguette HQ / USAMI Kenta
>
> MIT License
>
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.9% 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 ~1060 days

Total

4

Last Release

1162d ago

PHP version history (2 changes)0.5.0PHP &gt;=5.5.0

0.6.0PHP &gt;=7.2.0

### Community

Maintainers

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

---

Top Contributors

[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (46 commits)")[![ttsuki](https://avatars.githubusercontent.com/u/1332054?v=4)](https://github.com/ttsuki "ttsuki (1 commits)")

---

Tags

accept-languagehttpphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zonuexe-http-accept-language/health.svg)

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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