I used this for a site i helped make, this is the m3u make
<?
header("Content-type: audio/x-mpegurl");
$file = $_REQUEST["file"];
$file = ereg_replace("[[:space:]]", "%20", $file);
print ($file);
?>
and this is part of the file listing used to sort out the hi-fi and lo-fi files it was setup so that they uploaded "songname.mp3" and "songname (lofi).mp3"
if(!is_dir($path)) {
$no = "This band has not uploaded any samples";
}
else{
chdir($path);
$cur_dir = opendir($path) or die ("Unable to open your folder. Please contact the Admin");
while(false !== ($file = readdir($cur_dir))) {
if ($file != "." && $file != ".." && eregi("(lofi)", $file) != TRUE) {
$files[] = $file;
}
else if ($file != "." && $file != "..") {
$lofifiles[] = $file;
}
}
closedir($cur_dir);
if($files == NULL) {
$no = "This band has not uploaded any samples";
}
hope this helps