- date: documentation ( source)
- strtotime: documentation ( source)
<?php
echo '<select id="etime" name="etime">'."\n";
for($i2 = 6; $i2 < 21; $i2++, $d2 = date("h A", strtotime($i2 . ":00:00"))) {
$selected2 = ($i2 == 18) ? 'selected' : '';
echo '<option '.$selected2.' value="'.date("H:i:s", strtotime($i2 . ":00:00")) .'">'. $d2.'</option>'."\n";
}
echo '</select>'."\n";
?>