PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?
//define the path as relative
$path = "/homepages/21/d155481990/htdocs/server";
//using the opendir function
$dir_handle = @opendir($path) or die("Error, oh noez!");
//echo "Directory Listing of $path<br/>";
//echo "";
//running the while loop
while ($file = readdir($dir_handle))
{
if($file!="." && $file!=".." && $file!="songlist.php" && $file!="song.php" && $file!="music.html" && $file!="songdevlist.php" && $file!="id3.php" && $file!="" && $file!="id3.php" && $file!="artistlisttest.php" && $file!="toastplayer" && $file!=null && $file!=".mp3" && $file!="mp3list.php" && $file!="playsong.php" && $file!="index.php")
$newfile = str_replace(".mp3", "", $file);
echo "<a href=\"playsong.php?song=$newfile\" target=\"song\">$newfile</a><br/>";
}
//closing the directory
closedir($dir_handle);
?>
It's really annoying to have it display a file 6 times. Why is it doing this, or how can I get it to remove multiple entries of the same content from an array and just leave one?