Seite 1 von 1

.log Datei rückwerts auslesen

Verfasst: 06.02.2009 22:17
von Domitz
Hallo, habe folgenden Code:

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 />";
	}


}
}
wie schaffe ich es, dass die Datei rückwerts ausgelesen wird? Momentan sind die neuen Einträge oben, will die aber unten haben :/

danke =)

Re: .log Datei rückwerts auslesen

Verfasst: 06.02.2009 22:37
von S2B
[php:krsort] vs. [php:ksort]