I have the time combobox which is showing the time properly and storing in database.
How to select the time in that list which is stored in the database.
In the database the stored time is 02:30
and in this all times are there i want to select the 02:30
from this list this time list is automatically populated.
Any help will be appreciated.
My Code
<select name="open" class="form-control" style="width: 112px;">
<?php
$start=strtotime('00:00');
$end=strtotime('23:59');
for ($halfhour=$start;$halfhour<=$end;$halfhour=$halfhour+30*60) {
printf('<option value="%s">%s</option>',date('H:i',$halfhour),date('g:i a',$halfhour));
}
?>
</select>