- date: documentation ( source)
- strtotime: documentation ( source)
- sprintf: documentation ( source)
<?php
$output = [];
for ($day = 0; $day < 21; $day++) {
$output[] = strtotime(sprintf('+%d days', $day));
}
echo "<select name='days'>";
foreach ($output as $day)
{
echo "<option value='".$day."'>".date('l jS \of F Y', $day)."</option>";
}
echo "</select>";