<? $things = file('server.log'); $chats = Array(); foreach ($things as $thing) { if (strpos($thing, "[INFO] <")) { $chats[] = htmlspecialchars(substr($thing, 27)); } } $chatt = implode("<br />", array_slice($chats, -30)); echo $chatt; ?>
It's on the first post of the thread (I try to keep post 1 updated)
<?php echo nl2br(htmlentities(`tail -n 30 server.log | grep '\[INFO\] <' | cut -b 28-`));
How do I reverse the output so the newest is at the top?
I've tried "array_reverse" in various places with no luck yet.
I've sorted it anyway
There was once place I hadn't tried :)