I am using the following code to list the files in a directory and place a checkbox next to each file. It works well, but it does not print the files in any specific order. Would like to have the files print on the screen in alphabetical order.
Any input would be greatly appreciated. Thanks!
//define the path as relative
$path = "../audio/$audio_upc";
// List all files in directory w/ checkbox for deletion:
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
//running the while loop
while ($file = readdir($dir_handle))
{
if($file!="." && $file!=".." && $file!="skins" && $file!="wimpy.php" && $file!="WMR_Player.htm" && $file!="wimpy.swf")
// Modified so it's an array for multiple selections
echo "<input type=\"checkbox\" name=\"delete[]\" value=\"$file\">$file<br>";
}
//closing the directory
closedir($dir_handle);