我将如何对目录进行排序以按字母顺序显示下拉列表?
<select name=country>
<?php
$handle=opendir("images/flags");
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$country = substr($file,0,strpos($file,'.'));
echo "<option value=\"".$file."\"><center>".$country."</center></option>\n";
}
}
closedir($handle);
?>
</select>