Internationalization Locale::getAllVariants
Locale::getAllVariants
locale_get_all_variants
(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)
Locale::getAllVariants -- locale_get_all_variants — 입력 로케일에 대한 변형을 가져옵니다.
설명
객체 지향 스타일
public static Locale::getAllVariants(string $locale
): ?array
절차적 스타일
locale_get_all_variants(string $locale
): ?array
입력 로케일에 대한 변형을 가져옵니다.
매개변수
locale
- 변형을 추출할 로케일
반환 값
로케일에 대한 모든 변형 하위 태그 목록을 포함하는 배열 또는 존재하지 않는 경우 null
locale
길이가 INTL_MAX_LOCALE_LEN
을 초과하면 null
을 반환합니다.
Examples
예제 #1 locale_get_all_variants() 예제
<?php
$arr = locale_get_all_variants('sl_IT_NEDIS_ROJAZ_1901');
var_export( $arr );
?>
예제 #2 OO 예제
<?php
$arr = Locale::getAllVariants('sl_IT_NEDIS_ROJAZ_1901');
var_export( $arr );
?>
위의 예는 다음을 출력합니다.
array ( 0 => 'NEDIS', 1 => 'ROJAZ', 2 => '1901', )
기타
- locale_get_primary_language() - 입력 로케일의 기본 언어를 가져옵니다.
- locale_get_script() - 입력 로케일에 대한 스크립트를 가져옵니다.
- locale_get_region() - 입력 로케일의 지역을 가져옵니다.