Get a numerically indexed array containing all defined timezone identifiers in PHP

Description

The following code shows how to get a numerically indexed array containing all defined timezone identifiers.

Example


// w  ww  .j  a  v a 2  s.  c o  m
<?php
$timezone_identifiers = DateTimeZone::listIdentifiers();
for ($i=0; $i < 5; $i++) {
    echo "$timezone_identifiers[$i]\n";
}
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone