Thanks Weedpacket and Laserlight - really helpful.
I now have the following code:
$dir = "pictures";
$files = scandir($dir, 0);
for( $ctr = 1; $ctr < sizeof( $files ); $ctr++ ) {
if($files[$ctr] != "." && $files[$ctr] != "..")
if (sscanf($files[$ctr], '%4d%2d%2d', $year, $month, $day) == 3) {
$months = array(1 => 'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December');
$date = "$day $months[$month] $year";
}
print "<a href='list_pictures.php?pics=$dir/$files[$ctr]'>$date</a><br>";
}
which gives a nice list:
19 March 2010
20 March 2010
25 March 2010
26 March 2010
27 March 2010
which all link to the directory of the pics to be displayed 🙂
But, how do I make it show the list with the most recent one first?
Thanks
R