<? $things = file('server.log'); $chats = ""; foreach ($things as $thing) { if (strpos($thing, "[INFO] <")) { $chats .= htmlspecialchars(substr($thing, 27)) . "<br />"; } } echo $chats; ?>
<? $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-`));