PHP class for generating of PLS playlist files.

v1.0.1 2018-06-24 11:48 UTC

This package is auto-updated.

Last update: 2024-07-14 07:28:19 UTC


PHP class for generating of PLS playlist files.

Become a Patron! Buy me a coffee


Download a latest package or use Composer:

composer require czproject/plsgenerator

PlsGenerator requires PHP 5.3.0 or later.


$playlist = new Cz\PlsGenerator;

// add track (only $filename is required paramater)
$playlist->addTrack($filename, $title, $length);

// generate (print to page)
echo $playlist; // or echo $playlist->generate();

// or save playlist into file

Dynamic online playlist

header('Content-type: ' . Cz\PlsGenerator::MIME_TYPE);
header('Content-Disposition: attachment; filename="music.pls"');

$playlist = new Cz\PlsGenerator;

// add tracks
$playlist->addTrack('track1.mp3', 'Oasis - The Masterplan');
$playlist->addTrack('track2.mp3', 'The Cranberries - Zombie');

// send to browser
echo $playlist;

License: New BSD License
Author: Jan Pecha,