DateTimeZone::listIdentifiers
(PHP 5 >= 5.2.0)
DateTimeZone::listIdentifiers — すべてのタイムゾーン識別子を含む配列を返す
説明
staticarray DateTimeZone::listIdentifiers
([ int $what = DateTime::ALL
[, string $country = NULL
]] )
パラメータ
- what
-
DateTimeZone のクラス定数のいずれか。デフォルトは DateTimeZone::ALL。
- country
-
2 文字の ISO 3166-1 互換の国コード。
注意: このオプションを使用するのは、what に DateTimeZone::PER_COUNTRY を設定した場合のみです。
返り値
成功した場合に配列、失敗した場合に FALSE を返します。
変更履歴
| バージョン | 説明 |
|---|---|
| 5.3.0 | オプションのパラメータ what および country が追加されました。 |
例
例1 timezone_identifiers_list() の例
<?php
$timezone_identifiers = DateTimeZone::listIdentifiers();
for ($i=0; $i < 5; $i++) {
echo "$timezone_identifiers[$i]\n";
}
?>
上の例の出力は、 たとえば以下のようになります。
Africa/Abidjan Africa/Accra Africa/Addis_Ababa Africa/Algiers Africa/Asmera
DateTimeZone::listIdentifiers
There are no user contributed notes for this page.
