I would use xpath for this, see http://php.net/manual/de/simplexmlelement.xpath.php$result = $xml->xpath("//image[@size="mega]/text()")This would select the content of all image nodes with a size="mega" attribute.You only would have to fetch the first result, done :)

ditto

Hi guys,does somebody know is it possible to add artists from mentioned image xml list (api library.getArtists) to another account using api library.addArtists without building any app or something? Maybe there is some third-party app already written?

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

(It's maybe a bit late for the answer, but it could help someone, someday) The first code is quite correct, it's just that simplexml does not care about the "real" value of the attribute <image size="">, if it sees several lines with the same attribute but different propreties setted, it will store it into an array, so you can access to it with ->image[0-4]