略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Locale::canonicalize

2024-12-21

Locale::canonicalize

locale_canonicalize

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)

Locale::canonicalize -- locale_canonicalizeCanonicalize the locale string

说明

public static Locale::canonicalize(string $locale): ?string

警告

本函数还未编写文档,仅有参数列表。

参数

locale

返回值

Canonicalized locale string.

locale 的长度超过 INTL_MAX_LOCALE_LEN 时返回 null

add a noteadd a note

User Contributed Notes 1 note

up
2
jerome at chaman dot ca
6 years ago
this method performs Level 1 and Level 2 canonicalization according to ICU standards. See http://userguide.icu-project.org/locale#TOC-Canonicalization.

echo \Locale::canonicalize ( 'en-US.utf8' );
// "en_U"
echo \Locale::canonicalize ( 'FR-fr@EURO' );
// "fr_FR@currency=EUR"
echo \Locale::canonicalize ( '' );
// "en_US_POSIX"

官方地址:https://www.php.net/manual/en/locale.canonicalize.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3