Locale::composeLocale() - Locale类
Locale::composeLocale()
locale_compose
(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0)
Returns a correctly ordered and delimited locale ID
说明
面向对象风格publicstaticLocale::composeLocale(array $subtags): string过程化风格
locale_compose(array $subtags): string
Returns a correctly ordered and delimited locale ID the keys identify the particular locale ID subtags, and the values are the associated subtag values.
参数
$subtagsan array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the associated subtag values.Note:
The 'variant' and 'private' subtags can take maximum 15 values whereas 'extlang' can take maximum 3 values.e.g. Variants are allowed with the suffix ranging from 0-14. Hence the keys for the input array can be variant0, variant1,...,variant14. In the returned locale id, the subtag is ordered by suffix resulting in variant0 followed by variant1 followed by variant2 and so on.
The 'variant','private' and 'extlang' multiple values can be specified both as array under specific key(e.g.'variant')and as multiple numbered keys(e.g.'variant0','variant1', etc.).
返回值
The corresponding locale identifier.
范例
locale_compose() example
OO example
以上例程会输出:
Locale: en_Hans_CN_nedis_rozaj_x_prv1_prv2
参见
- locale_parse() Returns a key-value array of locale ID subtag elements
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!