在 php 中获取带有国家/地区代码的区域设置


Get locale in php with a country code

如果我有国家代码或时区,我们如何获取与国家/地区关联的区域设置或所有区域设置。

一个国家可以有多种语言,因此可以有许多区域设置。

这应该可以解决您的问题:

http://php.net/manual/en/locale.getallvariants.php

$arr = Locale::getAllVariants('sl_IT_NEDIS_ROJAZ_1901');
var_dump( $arr );