Converting XML file elements into a PHP array -


i'm trying convert steam group members list xml file array using php. xml file is: http://steamcommunity.com/groups/starhawk/memberslistxml/?xml=1.xml

the elements member's steam ids, such 76561198000264284

how can go doing this?

edit: far i've used this:

$array = json_decode(json_encode((array)simplexml_load_string($xml)),1);  

it outputs first few elements, not ones

this should return accessible array:

$get = file_get_contents('http://steamcommunity.com/groups/starhawk/memberslistxml/?xml=1.xml'); $arr = simplexml_load_string($get); print_r($arr); 

you can access items this:

echo $arr->groupid64; echo $arr->members->steamid64;  

edit: parse streamid, can loop

$ids = $arr->members->steamid64; foreach($ids $id) {     echo $id; } 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -