You could always read the filenames into an array and then sort the array. If you want other information about each filename then either create more arrays or build a two-dimensional array.
PHP Code:
<?php
$dir = "/etc/php5/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
//$file is the filename
$fileNameArray[] = $file;
}
}
}
This gives you the array then you just have to sort it.
PHP Code:
$fileNameArray = sort($fileNameArray);
I believe that should give you what you are looking for...
..I reserve the right to say whoops, forgot to test that code....
Bookmarks