I needed a script to create a links page for about 500 songs I had in a folder automatically. It looks like this http://dadeebaker.com/music.shtml
the problem is I need to modify the code to alphabetize that because right now its completely scrambled, I'm terrible with php, so can someone help me out with this. Thanks
I used this code (music1 is the folder the music is in btw)
<?php
$dir = "music1";
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$name = str_replace(".mp3", "", $file);
echo '<a href="'. $dir .'/'. $file .'">'. $name .'</a><br />';
}
}
closedir($handle);
}
?>


Reply With Quote
Bookmarks