spok61438
02-26-2008, 06:42 AM
<?
$dir = "music/";
unset($param);
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if ($file != ".." && $file != "." && strstr($file,"mp3")) {
if ($param == "") {
$param = "music/" . rawurlencode($file);
} else {
$param .= "|" . "music/" . rawurlencode($file);
}
}
}
closedir($dh);
}
}
?>
What should I add to the script to make it sort the files alphabetically?
Thanks in advance!
$dir = "music/";
unset($param);
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if ($file != ".." && $file != "." && strstr($file,"mp3")) {
if ($param == "") {
$param = "music/" . rawurlencode($file);
} else {
$param .= "|" . "music/" . rawurlencode($file);
}
}
}
closedir($dh);
}
}
?>
What should I add to the script to make it sort the files alphabetically?
Thanks in advance!