Ordering files from a folder?
Posted: Mon Oct 06, 2003 5:04 pm
You know when you use this code to select files out of a folder:
It orders them alpabetically. Is it possible to change the way it is ordered? ASC, DESC, extensions etc...
Thanks
Code: Select all
<?php
$handle=opendir(".");
while ($file = readdir($handle)) {
if (is_file("./$file")) {
print $file;
}
closedir($handle);
?>Thanks