note 109423 added to datetimezone.listidentifiers

From: Date: Mon, 16 Jul 2012 11:09:39 +0000
Subject: note 109423 added to datetimezone.listidentifiers
Groups: php.notes 
Request: Send a blank email to php-notes+get-189154@lists.php.net to get a copy of this message
Here is an update to the above which has Antarctica spelled correctly and also deals with multiple cities such as argentina etc: <?php $timezone_identifiers = DateTimeZone::listIdentifiers(); foreach( $timezone_identifiers as $value ){ if ( preg_match( '/^(America|Antarctica|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].'">'; } if(isset($ex[2])) $city=$ex[1]."/".$ex[2]; else $city=$ex[1]; $continent=$ex[0]; echo '<option value="'.$value.'">'.$city.'</option>'; } } ?> </optgroup> </select> ---- Server IP: 69.147.83.197 Probable Submitter: 86.201.56.162 ---- Manual Page -- http://www.php.net/manual/en/datetimezone.listidentifiers.php Edit -- https://master.php.net/note/edit/109423 Del: integrated -- https://master.php.net/note/delete/109423/integrated Del: useless -- https://master.php.net/note/delete/109423/useless Del: bad code -- https://master.php.net/note/delete/109423/bad+code Del: spam -- https://master.php.net/note/delete/109423/spam Del: non-english -- https://master.php.net/note/delete/109423/non-english Del: in docs -- https://master.php.net/note/delete/109423/in+docs Del: other reasons-- https://master.php.net/note/delete/109423 Reject -- https://master.php.net/note/reject/109423 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#189154) next »