Is there any way of changing the following code so that it will not display the 31st day on months that only have 30 days.
Many thanks
$current_date = getdate();
$myhour = $current_date["hours"];
$myday = $current_date["mday"];
$mymonth = $current_date["mon"];
$myyear = $current_date["year"];
// THE PICKUP DAY
for ($i = 1; $i <= 31; $i++)
{
if ($i == $myday)
{
$pickupday[] = "<option selected>$i</option>";
}else{
$pickupday[] = "<option>$i</option>";
}
}
🙂