IntlCalendar::getKeywordValuesForLocale

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

IntlCalendar::getKeywordValuesForLocaleロケールのキーワードの値の集合を返す

説明

オブジェクト指向型

publicstaticIntlCalendar::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 を返します

例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 )
To Top