Hi, I'm quite new to php... never used array reverse before and can't get it to work!!!!
What I want to do, is output contents of a text file backwards - i.e. most recent first. i've but the code i'm using below... but how do I add array_reverse into it?
everything I've tried hasnt worked! Thanks.
function ReadFromFile() {
$TheFile = "guestbookdata.txt";
$Open = fopen ($TheFile, "r");
if ($Open) {
$Data = file ($TheFile);
for ($n=0; $n < count($Data); $n++) {
$GetLine = explode("\t", $Data[$n]);
print ("<table border=\"1\" bordercolor=\"black\" cellspacing=\"0\" cellpadding=\"4\" align=\"center\" width=\"400\">\n");
print ("<tr>\n");
print ("<td align=\"center\" width=\"10%\" rowspan=\"2\" valign=\"top\">ONE</td>\n");
print ("<td align=\"left\" width=\"*\">Posted by $GetLine[0] on $GetLine[3] <br><span style=\"font-size:8pt;\">$GetLine[1]</span> - <span style=\"font-size:8pt;\">$GetLine[4]</span></td>\n");
print ("<td align=\"center\" width=\"10%\" rowspan=\"2\" valign=\"top\">DEL</td>\n");
print ("</tr>\n");
print ("<tr>\n");
print ("<td align=\"left\" width=\"*\">$GetLine[2]</td>\n");
print ("</tr>\n");
print ("</table><br>\n");
}
fclose ($Open);
} else {
print ("<font color=red><b>Unable to load Guestbook. Please try again later.</b></font><br>\n");
}
}