note 88314 deleted from function.time by danbrown

From: Date: Tue, 20 Jan 2009 03:20:55 +0000
Subject: note 88314 deleted from function.time by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-149502@lists.php.net to get a copy of this message
Note Submitter: nuntius ---- I thought this might be useful to someone. Not sure if there is an easier way, but a first crack at it proved to be entertaining. Enjoy! function htmlTimeSelect(){ $line.="Time:<br/> <select name='time'>"; while($dayseg<2){ $dayseg++; if($dayseg==1){ $seg="AM"; }else{ $seg="PM"; } for($hr=1; $hr<13; $hr++){ if($hr<10){ $hr="0".$hr; } if($hr==12 && $seg=="AM"){ $seg="PM"; }elseif($hr==12 && $seg=="PM"){ $seg="AM"; } $min="00"; for($i=1; $i<=4; $i++){ $line.="<option value='".$hr."'>".$hr.":".$min." ".$seg; $min=$min+15; } } } $line.="</select><br/>"; return $line; }

« previous php.notes (#149502) next »