Right, I have a php script that read a news entrylist file. It searches for those which match the category required, and prints the details to the page. It all works fine, perfectly, but then my news page gets too big, so I want to cut it down only to the last 10 items. Any ideas? I've already been told to replace my while loop with a for loop, but then I get an error (expect T-While).
<?
if (($value>0) and ($value<=$catlength)) {
$total_length = count($line);
do {
$this_entry = explode('|', $line[$i]);
if (($this_entry[7] == $sec) and ($this_entry[5] == "O")) {
do the stuff!
}
$i++;
}
while ($i <= $total_length);
}
?>