Hi I'm struggling to get data from an xml file in php...
the xml file is here: http://musicbrainz.org/ws/2/artist/8bfac288-ccc5-448d-9573-c33ea2aa5c30?inc=release-groups
and so far after loading it into simplexml_load_file as $xml
I want to do something like this:
<?php
$url = "http://musicbrainz.org/ws/2/artist/8bfac288-ccc5-448d-9573-c33ea2aa5c30?inc=release-groups";
$xml = simplexml_load_file($url);
$releasegrouplist = "release-group-list";
$releasegroup = "release-group";
$i = "0";
for ($i = 0; $i <= 30; $i++)
{
echo "release: " . $xml->artist->$releasegrouplist->$releasegroup[$i]->title;}
The problem arises when I try to use it in a for loop with an $i variable as shown above.
Any tips or easier ways to do this?
Thanks everyone