Page 1 of 1

get data from XML

Posted: Sat Jul 25, 2009 8:34 am
by Tompa
Hi,

I have this xml; http://steamcommunity.com/id/suxxez/?xml=1 (example)
and Im now looking to get the data from the profile->onlineState node and put it into an php array to use on my website. How can I do this?

Thanks,
Tom

Re: get data from XML

Posted: Sat Jul 25, 2009 9:10 am
by Tompa
sorted it myself :P

final code:

Code: Select all

$fetch_steam_status = 'http://steamcommunity.com/profiles/'.$ds['steam_id_name'].'/?xml=1';
            $xml = simplexml_load_file($fetch_steam_status);
            
            $steam_nickname = $xml->steamID;
            $steam_status = $xml->onlineState;
            $steam_status_msg = $xml->stateMessage;
            $steam_play_time = $xml->hoursPlayed2Wk;