PHP code example of jalle19 / xsphpf
1. Go to this page and download the library: Download jalle19/xsphpf library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jalle19 / xsphpf example snippets
// Create a playlist
$playlist = new Jalle19\xsphpf\Playlist();
// Create a track
$track = new Jalle19\xsphpf\Track('http://example.com/song_1.mp3');
// Define some optional attributes for the track
$track->setTitle('Some fancy title')
->setDuration(300)
->setImage('http://example.com/image.jpeg');
// Add the track to the playlist
$playlist->addTrack($track);
// Serialize the playlist to XML
$xml = $playlist->__toString();