Home | Geschichten | Kunst | Computer | Tindertraum |
<?php
function nextfivedays() {
$days = 0; $i = 0;
$fivedays = array();
$daysallowed =
array('Mon' => 'Montag',
'Tue' => 'Dienstag',
'Wed' => 'Mittwoch',
'Thu' => 'Donnerstag',
'Fri' => 'Freitag');
while ($days < 5) {
$newday =
mktime (0,0,0,date("m"), date("d")+$i, date("Y"));
if ($daysallowed[date("D", $newday)]) {
$fivedays[date("d.m.Y",$newday)] =
$daysallowed[date("D", $newday)]
." den ".date("d.m.Y",$newday);
$days++;
}
$i++;
}
return $fivedays;
}
?>
<select name="theDay">
<?php
$days = nextfivedays();
while (list($day, $daystring) = each($days)) {
echo "<option value=\"$day\"";
if ($theDay==$day) {
echo " selected";
}
echo ">$daystring\n";
}
?>
</select>
[ by Martin>] [permalink] [similar entries]
similar entries (vs):
similar entries (cg):