note 102640 rejected from function.strftime by danbrown
[email protected] Fri, 25 Feb 2011 09:02:07 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
Note Submitter: thepaw at arcor dot de
----
@Lemmi .. how can I fix the "März" Problem in this Code ??
$tage = 30; // Zeige die Geburtstage der naechsten X-Tage an
$ausgabe = "";
$geburtstage = file("geburtstage.txt");
setLocale(LC_ALL, "de_DE", "german");
for ($zaehler = 0; $zaehler <= $tage; $zaehler++) {
$aktuell = date("d.m.Y", strtotime("+" . $zaehler . " day", time()));
list($tag, $monat, $jahr) = explode(".", $aktuell);
foreach ($geburtstage as $geburtstag) {
list($name, $tag2, $monat2, $jahr2) = explode("|", $geburtstag);
if ($tag2 == $tag && $monat2 == $monat) {
$ausgabe .= "<b>$name</b> (" . ($jahr - $jahr2) . ")<br>" . strftime("%d. %B $jahr2", mktime(0, 0, 0, $monat, $tag)) . "<br><br>";
}
}
}
if ($ausgabe != "") {
echo "Geburtstage in den<br>nächsten " . $tage . " Tagen:<br><br>" . $ausgabe;
}
else {
echo "In den nächsten " . $tage . " Tagen<br>hat niemand Geburtstag!<br><br>";
}
Thanks