Stream MP3 using PHP – m3u

11 Apr

M3U is a computer file format that stores multimedia playlists.


function m3u_stream($dir) {


$h1 = opendir($dir);

while ($file = readdir($h1))

if ($file == ‘.’ || $file == ‘..’) continue;



return $mp3;


$folder = “svnlabs”;

file_put_contents($folder.”.m3u”, m3u_stream($_SERVER[“DOCUMENT_ROOT”].”/mp3/”.$folder.”/”));


Here “svnlabs” is a folder where all mp3 files exists… this program will create svnlabs.m3u playlist file using php script.

svnlabs.m3u file contents all mp3 links with domain “;



Now can be used for streaming mp3 from

1 Comment

Posted by on April 11, 2010 in Fedora, Linux, php, Tips, Tricks, Web Services


Tags: , , , ,

One response to “Stream MP3 using PHP – m3u


    November 12, 2010 at 10:23 pm

    I doubt it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: