Kind of new to this, so sorry if I'm asking a dumb question.
I have made a list of times, which I have to put into a select menu. Kinda like this .
I actually want my list to be from 16:00 until 01:45 or 02:00 instead of 00:00-01:45 & 16:00-23:45, but I don't know how. And then the second thing is I couldn't manage to get this list into a
<select>
dropdown menu
This is the code I've got so far:
<?php
$exclude = array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
function echo_datelist($i, $j)
{
$time = str_pad($i, 2, '0', STR_PAD_LEFT).':'.str_pad($j, 2, '0', STR_PAD_LEFT);
echo $time.'<br />';
}
for ($i = 00; $i <= 23; $i++)
{
for ($j = 0; $j <= 45; $j+=15)
{
if (in_array($i, $exclude)) continue;
echo_datelist($i, $j);
}
}
?>