首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

IntlCalendar::getKeywordValuesForLocale

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

IntlCalendar::getKeywordValuesForLocale — Get set of locale keyword values

Description

Object oriented style

代码语言:javascript
复制
public static Iterator IntlCalendar::getKeywordValuesForLocale ( string $key , string $locale , boolean $commonlyUsed )

Procedural style

代码语言:javascript
复制
Iterator intlcal_get_keyword_values_for_locale ( string $key , string $locale , boolean $commonlyUsed )

For a given locale key, get the set of values for that key that would result in a different behavior. For now, only the 'calendar' keyword is supported.

This function requires ICU 4.2 or later.

Parameters

key

The locale keyword for which relevant values are to be queried. Only 'calendar' is supported.

locale

The locale onto which the keyword/value pair are to be appended.

commonlyUsed

Whether to show only the values commonly used for the specified locale.

Return Values

An iterator that yields strings with the locale keyword values or FALSE on failure.

Examples

Example #1 IntlCalendar::getKeyworkValuesForLocale()

代码语言:javascript
复制
<?php
print_r(
????????iterator_to_array(
????????????????IntlCalendar::getKeywordValuesForLocale(
????????????????????????'calendar',?'fa_IR',?true)));
print_r(
????????iterator_to_array(
????????????????IntlCalendar::getKeywordValuesForLocale(
????????????????????????'calendar',?'fa_IR',?false)));

The above example will output:

代码语言:javascript
复制
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
)

← IntlCalendar::getGreatestMinimum

IntlCalendar::getLeastMaximum →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com