Hey guys. This is my first post on your website. Sorry if it's in the wrong place or if this was brought up before! I looked through everything but couldn't find something related to this.
When it comes to flatfiles, I really am a beginner. I've got a question wich is probably very simple, but I've looked all over for an answer and haven't been able to find it yet so any help would be appreciated.
Here's the php code I'm using to display my Shoutbox
<?php
$lines = file("http://www.socomcentral.ne t/flashme/test.txt"); krsort($lines);
foreach($lines as $data) { list($name,$message ,$ip,$date,$time) = explode("||", $data);
echo " ---ECHO EVERYTHING OUT--- ";
} ?>
I'm just trying to find a way to show "X" amount of shouts instead of every single one of them. Just something small, like 5 or 6 shouts, would be ideal.
Like I said before, I'm not very good with flat files. If this was a MySQL database, I'd set it up like this:
$result = mysql_query("select * from shoutbox order by id desc limit 6");
I'm just trying to do the flatfile equivalent to that. If anyone knows how I could modify my code to display the last 6 shouts please let me know. I just figured out how to display them in descending order, now I just need to learn how to display only a few shouts on the page.
Thank you for your time and help.
