xml parser using php from a link

tommy_mac501

New Member
i have the following code in PHP\[code\]$link ="http://ws.audioscrobbler.com/2.0/?method=&user=xgayax" ."&api_key=b25b959554ed76058ac220b7b2e0a026";$xml = @simplexml_load_file($link);$tracks = $xml->recenttracks->track;for ($i = 0; $i < 3; $i++) { $playingnow = $tracks[$i]->attributes()->nowplaying; $name = $tracks[$i]->name; $artist = $tracks[$i]->artist; $url = $tracks[$i]->url; $date = $tracks[$i]->date; $img = $tracks[$i]->children(); $img = $img->image[0]; echo "<a href='" . $url . "' target='TOP'>"; if ($nowplaying == "true") { echo "Now playing: "; } echo "<img src='" . $img . "' alt='album' /> $artist . " - " . $trackname . " @ " . $date . " </a> ";}\[/code\]and i got the following error Parse error: syntax error, unexpected '@', expecting ',' or ';' on line 31any solution for this problem???
 
Back
Top