Zombie news
// load directory into array
$handle=opendir( "data/news");
while ($File = readdir($handle)) {
// do not add '.' and '..'
if ( $File != "." && $File != ".." ) {
// add it
$Entries [count ($Entries)] = $File;
}
}
// clean up and sort
closedir($handle);
// sort the entries
rsort($Entries);
// loop and print them
for ($Index=0; $Index < count($Entries); $Index++ ) {
// first print the date
print "";
print substr ( $Entries[$Index], 0, 10 ) . ":\n";
print "
";
readfile ( "data/news/" . $Entries[$Index] );
// print "
";
}
?>
Generated: March 11 2010 21:25:23.