I know that I can sort numerically using
sort($array, SORT_NUMERIC);
but it only supports numbers in front, but I need to sort strings like (string 3, string 1, string 2) to (string 1, string 2, string 3).
my code: (only the portion that shows that displays data)
if ($handle = opendir($midi_directory)) {
while (false !== ($dir = readdir($handle))) {
if ($dir != "." && $dir != "..") {
$id = $id+1;
$show[$id] = $dir;
}
}
closedir($handle);
}
sort($show);
reset($show);
for($i=0; $i<count($show); $i++) {
print "<a href='script_jukebox.php?dir=$show[$i]#fileplaying'>$show[$i]</a><br>";
}
What can I do? 😕