.log Datei rückwerts auslesen
Verfasst: 06.02.2009 22:17
Hallo, habe folgenden Code:
wie schaffe ich es, dass die Datei rückwerts ausgelesen wird? Momentan sind die neuen Einträge oben, will die aber unten haben :/
danke =)
Code: Alles auswählen
$beitraege = @file("chat/log.log");
krsort($beitraege);
foreach($beitraege as $ausgabe) {
$ausgabe = stripslashes($ausgabe);
$comment = explode("|",$ausgabe);
if (".$comment[0]." >= ".$zahlneu.")
{
if ($comment[4] == "Alle")
{
echo "(".$comment[1].") <span style='color: ".$comment[2].";'><b>".$comment[3]."</span>»</b> ".$comment[5]."<br />";
}
elseif ($comment[3] == "".$userdata['username']."")
{
echo "(".$comment[1].") <span style='color: ".$comment[2].";'><i><b>".$comment[3]." flüstert</span>»</b> ".$comment[5]."</i><br />";
}
}
}
danke =)