PHP timezone_identifiers_list() Function

PHP timezone_identifiers_list Function


Definition :

In php timezone_identifiers_list() Function is inbuilt function.PHP timezone_identifiers_list() function is used to return an indexed array containing all the timezone identifiers. It accepts atmost two parameters $datetimezone and $country. It returns an indexed array as output on success and False on failure.

Syntax

   timezone_identifiers_list(what, country)

Parameter 
Parameter Description
what Optional. Specifies a DateTimeZone class constant

1 = AFRICA
2 = AMERICA
4 = ANTARCTICA
8 = ARCTIC
16 = ASIA
32 = ATLANTIC
64 = AUSTRALIA
128 = EUROPE
256 = INDIAN
512 = PACIFIC
1024 = UTC
2047 = ALL
4095 = ALL_WITH_BC
4096 = PER_COUNTRY
country Optional. Specifies a two-letter ISO 3166-1 compatible country code

Given below example Print all timezones in Indian:

Output :

Array
(
    [0] => Indian/Antananarivo
    [1] => Indian/Chagos
    [2] => Indian/Christmas
    [3] => Indian/Cocos
    [4] => Indian/Comoro
    [5] => Indian/Kerguelen
    [6] => Indian/Mahe
    [7] => Indian/Maldives
    [8] => Indian/Mauritius
    [9] => Indian/Mayotte
    [10] => Indian/Reunion
)