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 :)
2011-08-04 22:09:29 [INFO] <RichyBoyWonder> Anyway, G & I are enjoying it 2011-08-04 22:09:40 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?Anyway, night. Will be back tomorrow with no Sian to bother me. She going away for Christening 2011-08-04 22:09:49 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?whie I'm stuck in work 2011-08-04 22:10:00 [INFO] <RichyBoyWonder> I may or may not be around 2011-08-04 22:10:16 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?If you are see you over the weekend. If not have a good weekend# 2011-08-04 22:10:20 [INFO] <RichyBoyWonder> Visiting G's Dad as he's not too well 2011-08-04 22:10:27 [INFO] <RichyBoyWonder> You too squire 2011-08-04 22:10:30 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?:( Sorry to hear that 2011-08-04 22:10:51 [INFO] [dynmap] ?[WEB] 86.154.231.70: ?Bye 2011-08-04 22:10:56 [INFO] <RichyBoyWonder> Ciao
<? $things = file('server.log'); $chats = Array(); foreach ($things as $thing) { if (strpos($thing, "[INFO] <")) { $chats[] = "[" . substr($thing, 11, 5) . "]" . htmlspecialchars(substr($thing, 27)); } else if (strpos($thing, "[dynmap]")) { $thing = str_replace(": ?", ": ", $thing); $chats[] = "[" . substr($thing, 11, 5) . "]" . htmlspecialchars(substr($thing, 37)); } } $chatt = implode("<br />", array_slice($chats, -30)); echo $chatt; ?>