Teto\HTTP\AcceptLanguage is HTTP Accept-Language header parser based on PHP Locale module.
- PHP (5.4+)
ext/intl
see tests/public/greeting.php.
Teto\HTTP\AcceptLanguage::detect()Teto\HTTP\AcceptLanguage::get()Teto\HTTP\AcceptLanguage::getLanguages()Teto\HTTP\AcceptLanguage::parse()
- Accepts
*(wildcard) tag*-Hant-*→{language: '*', script: 'Hant'}zh-*-TW→{language: 'zh', region: 'TW'}
- HTTP/1.1: Header Field Definitions #14.4 Accept-Language
- RFC 4647 - Matching of Language Tags
- RFC 5646 - Tags for Identifying Languages
HTTP
Accept-Languageheader parser for PHPCopyright (c) 2014 USAMI Kenta