Sleeper Posted April 3, 2012 Share Posted April 3, 2012 Hello. I'm trying to pull information out of an xml file. However I'm a bit lost in getting the actual value. $url="http://ws.audioscrobbler.com/2.0/?method=artist.getimages&artist=Dr%20Feelgood&limit=1&autocorrect=1&api_key=c107c9b5c09cb5693b6c19409dd984c1"; $xml = simpleXML_load_file($url,"SimpleXMLElement",LIBXML_NOCDATA); $largesquare=$xml->images->sizes->size[2]; Is what I have but its not pulling the information. The above url will give you the link to a set xml file for this example. And I want to get the info for the <size name="largesquare" width="126" height="126">http://userserve-ak.last.fm/serve/126s/43173899.jpg</size> I'm sure I'm doing something wrong that's a simple fix but I am lost here. In the sizes there are 6 different size options each with different names and I have no idea how to pull the one with the correct name that I need. Thank you to who ever can help me sort this out. Link to comment https://forums.phpfreaks.com/topic/260280-php-and-xml-question/ Share on other sites More sharing options...
Sleeper Posted April 3, 2012 Author Share Posted April 3, 2012 I meant to post this in the "php coding help" section. I have re-posted this in that area. We can close or delete this one. Thank You Link to comment https://forums.phpfreaks.com/topic/260280-php-and-xml-question/#findComment-1334083 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.