I'm a bit of a beginner in php. I have written a script that lists folders and displays files within them. I can't however figure out how to sort them alphabetialy. Does anyone have a suggestion of solving this? (I hope I don't have to change a lot of code, because I have used this code many places....)
$path ="Prosedyrer";
if ($handle = opendir($path))
{
$blacklist = array('.', '..', 'somedir', 'somefile.php');
while (false !== ($file = readdir($handle)))
{
if (!in_array($file, $blacklist))
{
echo "<li>$file</a>\n <ul class=\"sub\">";
}
}
}