All pastes #472635 Raw Edit

mapitos

public php v1 · immutable
·published 2007-05-05 18:56 UTC
rendered paste body
function findMusic($dir) {     $musicList = array();     $dirHandle = opendir($dir);     while (($file = readdir($dirHandle)) !== FALSE) {          echo "<br>\n$file";     echo "<br>\n $dir";          if ($file == "." || $file == "..") continue;          if (is_dir($dir . "/" . $file)) 	 {	 	echo "<br>full dir \n $dir \n $file ";		if(is_link($dir) || (is_link($file)))		{	echo "<br>symlink found , ignoring symlink!!!";			echo "<br>$dir./$file \n is a symlink";			echo "<br>Symlink found on \n $file in \n $dir";	         } else {	 	  $musicList=array_merge($musicList, findMusic($dir . "/" . $file));		  	}             }	   	  $extension = end(explode(chr(46), $file));	 // print $extension;              if(is_link($file))       {       echo "<br>file is a symlink";       } else {              if (strtolower($extension) == "mp3")        {        	$musicList[] = $dir . "/" . $file; 	}                                 }          }     closedir($dirHandle);     return $musicList;}