nasution/lang-detector

检测用户语言

0.0.1 2016-08-16 01:43 UTC

This package is auto-updated.

Last update: 2024-09-10 10:05:31 UTC


README

这是一个使用 $_SERVER['HTTP_ACCEPT_LANGUAGE'] 的非常简单的语言检测器。输出将是标准的 ISO 639-1

安装

composer require nasution/lang-detector

使用

require 'vendor/autoload.php';

use Nasution\LangDetector;

echo LangDetector::detect(); // Output: id, en, it, ja, my, ms.