I am trying to sort an array by letter, however there is a mixture of Lower case and upper case and it is ordered By upper fisrt and then by lower case.
I would like to ignore the case ofd the first letter as it is critical to the function that is running.
$handle = opendir("$publishdir");
$i = 0;
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && !ereg("x", $file)) {
$users[$i] = $file;
$i++;
}
}
//sort usernames
sort($users);
closedir($handle);
I'm thinking of writing a bubble sort,but my fear is that it will be slow as there are over a 1000 entries.
Any suggestions would be most appreciated
Cheers
Nick