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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -