Sorry, I realized my solution didn't show your starting time (12:00 AM). Here's the corrected version:
$start = strtotime('12am');
for ($i = 0; $i < (24 * 4); $i++) {
$tod = $start + ($i * 15 * 60);
echo date('H:i A', $tod) . '<br />';
}
Edit: I guess it still doesn't (00:00 AM). There should be a work-around, though.
Edit again: What the heck. Here:
if ($_POST['submit']) {
echo $_POST['time'];
}
echo '<br /><br />';
echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
echo '<select name="time">';
$start = strtotime('12am');
for ($i = 0; $i < (24 * 4); $i++) {
$tod = $start + ($i * 15 * 60);
$display = date('h:i A', $tod);
if (substr($display, 0, 2) == '00') {
$display = '12' . substr($display, 2);
}
$tag = '<option value="' . $display . '">' . $display . '</option>';
echo $tag;
}
echo ' <input type="submit" value="submit" name="submit" />';
echo '</select></form>';