I display the results of a directory listing of available pdf reports like this:
I need to sort the results alphabetically.... Can anyone help here, I guess I need to 1st write to an array, then sort array? Any help is greatly appreciated...
-Allen
Code:
// List bbcm
$current_dir = "/public_html/reports/bbcm/";
$path = "reports/bbcm/";
$dir = opendir($current_dir);
echo ("<br><hr width=225 align=left>Brown Mesa<br>");
while ($file = readdir($dir))
{
if ($file!="." && $file != "..")
{
echo ("<a href=\"$path$file\" target=\"reports\">$file</a><br>");
}}
I need to sort the results alphabetically.... Can anyone help here, I guess I need to 1st write to an array, then sort array? Any help is greatly appreciated...
-Allen