Skip to content

terachanple/php-http-accept-language

 
 

Repository files navigation

HTTP Accept-Language

Build Status Downloads this Month

Description

Teto\HTTP\AcceptLanguage is HTTP Accept-Language header parser based on PHP Locale module.

Requirements

  • PHP (5.4+)
    • ext/intl

Usage

see tests/public/greeting.php.

API

  • Teto\HTTP\AcceptLanguage::detect()
  • Teto\HTTP\AcceptLanguage::get()
  • Teto\HTTP\AcceptLanguage::getLanguages()
  • Teto\HTTP\AcceptLanguage::parse()

Features

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

Reference

Copyright

HTTP Accept-Language header parser for PHP

Copyright (c) 2014 USAMI Kenta

Packages

No packages published

Languages

  • PHP 87.4%
  • Ruby 12.6%