定制 syonix/http-header-accept-language 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

syonix/http-header-accept-language

Composer 安装命令:

composer require syonix/http-header-accept-language

包简介

A parser for the Accept-Language HTTP header following RFC 2616

README 文档

README

A parser for the Accept-Language HTTP header following RFC 2616

Build Status

Usage

use Syonix\Http\Header\AcceptLanguage\AcceptLanguage;

$parsed = AcceptLanguage::parse('da, en-gb;q=0.8, en;q=0.7'); // Returns Array ordered by quality (q)
$parsed = AcceptLanguage::match('de-CH, de-DE;q=0.9, de;q=0.8', ['de-DE', 'de']); // Returns 'de-DE'

Notes

  • AcceptLanguage::match() throws a RuntimeException, if none of the accepted languages matches and * is not in the Accept-Languages string.
  • If * is accepted and none of the other accepted languages match, the passed $default parameter is passed
  • If $default is omitted, the first element of the $locale array is returned.
  • Both parse and match are case insensitive.
  • parse always returns the case of the input string
  • match always returns the case of the provided locale array.
  • As per the RFC, the quality value defaults to q=1.

统计信息

  • 总下载量: 515
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固