note 96298 deleted from datetimezone.listidentifiers by danbrown
| From: | danbrown@php.net | Date: | Mon, 16 Jul 2012 15:02:11 +0000 |
| Subject: | note 96298 deleted from datetimezone.listidentifiers by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189166@lists.php.net to get a copy of this message | ||
Note Submitter: chema at garridodiaz dot com
----
I use this time zone select:
<select id="TIMEZONE" name="TIMEZONE">
<?php
$timezone_identifiers = DateTimeZone::listIdentifiers();
foreach( $timezone_identifiers as $value ){
if ( preg_match(
'/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $value ) ){
$ex=explode("/",$value);//obtain continent,city
if ($continent!=$ex[0]){
if ($continent!="") echo '</optgroup>';
echo '<optgroup label="'.$ex[0].'">';
}
$city=$ex[1];
$continent=$ex[0];
echo '<option
value="'.$value.'">'.$city.'</option>';
}
}
?>
</optgroup>
</select>