|
|
#6 |
|
Junior Member
Join Date: May 2003
Posts: 15
|
<?
function GetDirArray($sPath) { //Load Directory Into Array $handle=opendir($sPath); while ($file = readdir($handle)) { $retVal[count($retVal)] = $file; if (is_dir($sPath ."/". $retVal[count($retVal)-1])) $retVal[count($retVal) -1] = "/".$retVal[count($retVal)-1]; } //Clean up and sort closedir($handle); sort($retVal); return $retVal; } $PathToTheFiles = "./yourpath"; ##put directory of files here $files = GetDirArray($PathToTheFiles); for($x=0;$x < count($files);$x++)$str .= $files[$x] . chr(13) . chr(10); $fp = fopen("playlist.lst","w"); fwrite($fp, $str, strlen($str)); fclose($fp); echo "playlist built"; ?> just paste everything from <? until ?> in a file, name it blah.php, put it on your webserver, go to it in a browser or execute from shell, and presto, instant playlist, if you have php installed of course. you will have to delete the ./ and ../ from top of list, i didn't feel like coding that in, heh, enjoy, and ask if you have any more problems. |
|
|
|
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|