Created
September 19, 2017 11:06
-
-
Save pranid/6b187aba2c43f7ba45b6aa766d4f39ed to your computer and use it in GitHub Desktop.
Get PHP timezone list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* TIMEZONE GRABBER | |
* @author PRANEETH NIDARSHAN | |
*/ | |
$zones = timezone_identifiers_list(); | |
$new_list = array(); | |
foreach ($zones as $zone) { | |
$t_zone = explode('/', $zone); | |
if(isset($t_zone[1])) { | |
$new_list[$t_zone[0]][$t_zone[1]] = $zone; | |
} else { | |
$new_list[$t_zone[0]] = $t_zone[0]; | |
} | |
} | |
var_dump($new_list); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment