Freelance PHP programmer India | Freelance web developer india | Web development India | web developer CV india | Compiling PHP and Apache 2 from source on Linux
DateTimeZone
PHP Manual

DateTimeZone::listIdentifiers

(No version information available, might be only in CVS)

DateTimeZone::listIdentifiersReturns numerically index array with all timezone identifiers

Description

array DateTimeZone::listIdentifiers ([ int $what=DateTime::ALL [, string $country=NULL ]] )
array timezone_identifiers_list ([ int $what=DateTime::ALL [, string $country=NULL ]] )

Parameters

object

Procedural style only: A DateTime object returned by date_create()

what

One of DateTimeZone class constants, defaults to DateTimeZone::ALL.

country

A two-letter ISO 3166-1 compatible country code.

Return Values

Returns array on success or FALSE on failure.

Examples

Example #1 A timezone_identifiers_list() example

<?php
$timezone_identifiers 
DateTimeZone::listIdentifiers();
for (
$i=0$i 5$i++) {
    echo 
"$timezone_identifiers[$i]\n";
}
?>

The above example will output something similar to:

Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmera

See Also


DateTimeZone
PHP Manual