darkestnight
12-14-2004, 11:58 AM
I have a script which lists folder names (and does something to them for an image gallery). Is there a way I can adapt my script so it displays the folders in the order of 'last modified' so the most recently modified folder is the first in the list?
Thank you in advance!
Here's my current PHP. This lists the folders (and does something to them) but does not order it by 'last modified'.
<?php
$d = opendir('images');
while (($file = readdir($d)) !== false) {
if ((filetype("images/$file") == 'dir') && (substr($file,0,1) != '.')) {
$nfile = str_replace('_',' ',$file);
print "<li><a href=\"gallery.php?gallery=$file\">$nfile</a></li>";
}
}
?>
Thank you in advance!
Here's my current PHP. This lists the folders (and does something to them) but does not order it by 'last modified'.
<?php
$d = opendir('images');
while (($file = readdir($d)) !== false) {
if ((filetype("images/$file") == 'dir') && (substr($file,0,1) != '.')) {
$nfile = str_replace('_',' ',$file);
print "<li><a href=\"gallery.php?gallery=$file\">$nfile</a></li>";
}
}
?>