Quote:
|
Originally Posted by HHSJosh
I do have access to three MYSQL databases, but I haven't yet learned how to interface with MYSQL yet. Also, I use the array_reverse() function to read the newest news from the top of the file, I just need some way where I can just get the newest five stories to display.
|
Hm...maybe seperate each item by underscores or something, and scan the file for it, and each time it's found, fill an array w/ the info and also use a counter. An example:
PHP Code:
// number of news items read
$num_news = 0;
// global array defined here
// open file for reading
$file = fopen("news.txt", "r");
// read file
$stuff = fread($file);
// loop through the reading
while(($num_news < 5) && ($stuff != eof())){
/* store news items in an array...I'm not sure on howto do this, so... */
}