XML : Get artist image from last.fm xml (api artist.getinfo)

I wanted to ask you help I have an xml source (http://livefmhits.6te.net/nowplay.xml) it gives me the source of the song and I wanted to remove the cover through the lastfm (artist.getinfo) in echo I tried as follows:

  <?php  $xml = simplexml_load_file('http://livefmhits.6te.net/nowplay.xml');  $artist = urlencode($xml->TRACK["ARTIST"]);       $url = 'http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist='.$artist.&api_key=b25b959554ed76058ac220b7b2e0a026;  $xml2 = @simplexml_load_file($url);  if ($xml2 === false)   {      echo("Url failed"); // do whatever you want to do  }  else  {      if($xml2->track->album->image[3])      {          echo '<img src="';          echo((string) $xml2->track->album->image[3]);              echo '">';      }      else      {           echo "<img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjovAmElfLlXvth_bgyBCBcPPdTJXnnwvojpNQUvkLoH2ud3dD8Nl50nu6WzxPThabiDg-Z-VXfoCSsP-0rOyzvMhFsh9qEAW6lQ97MA4dek1v5OIztVlBk_l7yQO-RdQasbIe5_HpFeTWO/s1600/capaindisponivel.png'"; // do whatever you want to do      }  }    

I'm not able to extract the source must be wrong echo, I like to remove the image that says "mega". I present to you the complete link http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&lang=ru&artist=COLDPLAY&api_key=ae9dc375e16f12528b329b25a3cca3ee and yet I was to do a post yours but I could not (Get large artist image from last.fm xml (api artist.getinfo))

I came to ask your help in this work from the outset thanks for availability

No comments:

Post a Comment