#html5 playlist from xml file # <?php /* first load the XML and create the containing div */ $playlistRawXML = file_get_contents('http://example.com/path/to/playlist.xml'); try { $playlist = new SimpleXMLElement($playlistRawXML); } catch (Exception $e) { /* if SimpleXML can't parse the file, it'll throw an exception */ echo "XML parsing error"; var_dump($e); exit; } ?> <div id="player-holder"> <audio preload></audio> <ul> <?php /* then, for each song in the playlist, render a list item: */ foreach($playlist->item as $song) { echo '<li><a data-src="' . $song->path . '" href="#">' . $song->title . ' (' . $song->artist . ')</a></li>'; } /* and then end the list, div, etc.: */ ?> </ul> </div>