Hello, I am attempting to create a news archive using one page to display the latest news and another that list links to the previous news.
To do this I would like to have each news item as a line in a text file (flat text database), each line being seperated by tabs for the item's name. For example:
2002 Update This website has been updated.
New Section A new <a href="">section</a> has been added.
and so on ...
I can display these in the archive page already with the following code:
$array=file("newsarchive.txt");
foreach ($array as $line)
if (ereg("([\t])\t+([\t])$", trim($line), $reOut)) {
echo "<b><a href=\"http://www.website.com/currentnews.php?item=$reOut[1]\" target=\"new\">$reOut[1]</a></b><br>";
}
My problem is for displaying items individualy by calling one of the variables, in this case $reOut[1].
I would like to fetch the newsarchive.txt file, point to the line specified in the URL and display the second variable of that line, that is the news content.
How do I go about doing this?
Thank you!