I want the track-id that is listed in the href attribute.
This is the spotify xml file:
http://ws.spotify.com/search/1/track?q=Sportfreunde+Stiller+AND+track:Ein+Kompliment
This is what I tried so far:
$url = "http://ws.spotify.com/search/1/track?q=Sportfreunde+Stiller+AND+track:Ein+Kompliment";
$xml = simplexml_load_file($url);
foreach ($xml->track as $track) {
echo $track->name."<br>";
}
How to get in the upper hierarchy?
This is the desired output: spotify:track:3ptJBraFGtaeprD4BHmTfV
. In my code I just put the name of the track in the output so that you can see that I am in the wrong hierarchy.