read()) { $ps = strpos(strtolower($entry), $filter); if (!($ps === false)) { $items[] = $entry; } } $d->close(); sort($items); } // third, the playlist is built in an xspf format // we'll first add an xml header and the opening tags .. header("content-type:text/xml;charset=utf-8"); echo "\n"; echo "\n"; echo " Sample PHP Generated Playlist\n"; echo " http://www.jeroenwijering.com/\n"; echo " \n"; // .. then we loop through the mysql array .. for($i=0; $i\n"; echo " ".($i+1).". ".$items[$i]."\n"; echo " ".$directory.'/'.$items[$i]."\n"; echo " \n"; echo " \n"; } // .. and last we add the closing tags echo " \n"; echo "\n"; /* That's it! You can feed this playlist to the SWF by setting this as it's 'file' parameter in HTML. Assuming you use the mp3player, the HTML code looks like this: */ ?>