What Pablo told you is fine. Did you try it? It puts the lines of a file into an array and you can do what you want for each line.
ie
// get a file into an array
$fcontents = file ('path to/logfile');
while (list ($line_num, $line) = each ($fcontents)) {
echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) . "<br>\n";
}
will print it out line by line, if you do:
$total_lines=count($fcontents);
you will get the total number of lines which means doing a for loop:
for ($i=$total_lines;$i>0;$i--) {
echo "<b>Line $i:</b> " . htmlspecialchars ($fcontents[$i]) . "<br>\n";
}
will print it backwords.
-David