<select size="1" name="project">
<?php
// Initialize the array that will hold the
// file names
$files = array();
if ($handle = @opendir('/path/to/my/files/here/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
// Add the file (if it is a file) to the array
$files[] = $file;
}
}
closedir($handle);
// If we have items in the array, sort the files naturally
if(count($files) > 0) natcasesort($files);
// Loop through the sorted array and
// print out the files
foreach($files as $output){
echo "$output\n";
echo '<option value="$output\n"</option>';
}
}
?>
</select>
I got bored so I wrote the code for you 😉
[edit] I made an edit for error checking.