ScottyBurton Posted February 24, 2016 Share Posted February 24, 2016 I am wanting to parse certain info from this XML - http://steamcommunity.com/profiles/76561198283429063/?xml=1 The only info I need is <onlineState>offline</onlineState> <stateMessage> <![CDATA[ Last Online 8 hrs, 6 mins ago ]]> </stateMessage> <avatarFull> <![CDATA[ http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/3c/3ceab5ad022b8a02390bd10253591ab26176ad13_full.jpg ]]> </avatarFull> <mostPlayedGames> </mostPlayedGames> I've been troubled with this for a while. Cheers for the help. Quote Link to comment https://forums.phpfreaks.com/topic/300879-xml-php-help/ Share on other sites More sharing options...
requinix Posted February 25, 2016 Share Posted February 25, 2016 Load the XML into SimpleXML $xml = new SimpleXMLElement("http://steamcommunity.com/profiles/76561198283429063/?xml=1", 0, true);then use SimpleXML's "simple" means of accessing information. Keep in mind that most of what you get from it will be objects and not strings so you'll probably want to (string)-typecast stuff. If you have a problem with something in particular then post your code and an explanation of what's going wrong. Quote Link to comment https://forums.phpfreaks.com/topic/300879-xml-php-help/#findComment-1531438 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.