aus der Reihe: Traumwind 'stupid but entertaining PihÄhtschPih tricks'™


aus der Reihe: Traumwind 'stupid but entertaining PihÄhtschPih tricks'™

22.08.2002, 13:56 · Martin · Permalink


<?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>


alles Bild, Text und Tonmaterial ist © Martin Spernau, Verwendung und Reproduktion erfordert die Zustimmung des Authors

Martin Spernau
© 1994-2026


amazon.de Wunschliste

Facebook me!
Google+

powered by Traumtank