Skip to content
HTTP Accept-Language header parser
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.phan
build
src
tests
.editorconfig
.gitignore
.scrutinizer.yml
.travis.yml
LICENSE.txt
README.md
Rakefile
composer.json
phpdox.xml.dist
phpunit.xml.dist

README.md

HTTP Accept-Language

Package version Build Status Downloads this Month Scrutinizer Code Quality

Description

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

Requirements

  • PHP (5.4+)
    • ext/intl

Installation

Composer

Get Composer. (use composer or composer.phar command)

cd /path/to/your-project
composer require 'zonuexe/http-accept-language:~0.4.1'

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) 2016 USAMI Kenta / Baguette HQ

You can’t perform that action at this time.