Hello,
I want to read all the files in a folder & display them in a drop down menu. I'm using the code below & it works fine. I now want the file names to be sorted ascending before it is displayed in the drop down menu. How do I do that? Thank you very much for your help.
<select size="1" name="project">
<?php
if ($handle = opendir('/path/to/my/files/here/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
echo '<option value="$file\n"</option>';
}
}
closedir($handle);
}
?>
</select>