我想問你的幫助我有一個xml源(http://livefmhits.6te.net/nowplay.xml)它給了我這首歌的來源,我想通過lastfm去掉封面( artist.getinfo)回聲我試過如下:從last.fm獲取藝術家圖像xml(api artist.getinfo)
<?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='http://3.bp.blogspot.com/-SEsYAbASI68/VZ7xNuKy-GI/AAAAAAAAA3M/IWcGRDoXXms/s1600/capaindisponivel.png'"; // do whatever you want to do
}
}
我不能夠提取源必須是錯的回聲,我想刪除,上面寫着「巨型」的形象。我向你完整的鏈接 http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&lang=ru&artist=COLDPLAY&api_key=ae9dc375e16f12528b329b25a3cca3ee,但我做了後你的,但我不能(Get large artist image from last.fm xml (api artist.getinfo))
我來問你的幫助,這項工作從一開始就感謝可用性
SuN,這個工作沒事,謝謝! –