Internationalization IntlCalendar::getKeywordValuesForLocale

IntlCalendar::getKeywordValuesForLocale

(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL >= 3.0.0a1)

IntlCalendar::getKeywordValuesForLocale — 로케일 키워드 값 세트 가져오기


설명

객체 지향 스타일

public static IntlCalendar::getKeywordValuesForLocale(string $keyword, string $locale, bool $onlyCommon): IntlIterator|false

절차적 스타일

intlcal_get_keyword_values_for_locale(string $keyword, string $locale, bool $onlyCommon): IntlIterator|false

주어진 로케일 키에 대해 다른 동작을 초래할 해당 키에 대한 값 세트를 가져옵니다. 현재는 'calendar' 키워드만 지원됩니다.

이 함수를 사용하려면 ICU 4.2 이상이 필요합니다.


매개변수

keyword
관련 값을 쿼리할 로캘 키워드입니다. 'calendar'만 지원됩니다.
locale
키워드/값 쌍이 추가될 로케일입니다.
onlyCommon
지정된 로케일에 일반적으로 사용되는 값만 표시할지 여부입니다.

반환 값

로케일 키워드 값이 있는 문자열을 생성하거나 실패 시 false를 생성하는 반복기입니다.


Examples

예제 #1 IntlCalendar::getKeyworkValuesForLocale()

                  
<?php
print_r(
        iterator_to_array(
                IntlCalendar::getKeywordValuesForLocale(
                        'calendar', 'fa_IR', true)));
print_r(
        iterator_to_array(
                IntlCalendar::getKeywordValuesForLocale(
                        'calendar', 'fa_IR', false)));
                  
                

위의 예는 다음을 출력합니다.

Array
(
    [0] => persian
    [1] => gregorian
    [2] => islamic
    [3] => islamic-civil
)
Array
(
    [0] => persian
    [1] => gregorian
    [2] => islamic
    [3] => islamic-civil
    [4] => japanese
    [5] => buddhist
    [6] => roc
    [7] => hebrew
    [8] => chinese
    [9] => indian
    [10] => coptic
    [11] => ethiopic
    [12] => ethiopic-amete-alem
)