This is my XML file:
<gamesList>
<ID1>00000000000</ID1>
<ID>USER</ID>
<games>
<game>
<appID>000000</appID>
<name>Dead Rising 3</name>
<logo></logo>
<storeLink></storeLink>
<hoursLast2Weeks>7.2</hoursLast2Weeks>
<hoursOnRecord>7.2</hoursOnRecord>
<statsLink></statsLink>
<globalStatsLink></globalStatsLink>
</game>
<game>
<appID>000000</appID>
<name>Dead Rising 3</name>
<logo></logo>
<storeLink></storeLink>
<hoursLast2Weeks>7.2</hoursLast2Weeks>
<hoursOnRecord>7.2</hoursOnRecord>
<statsLink></statsLink>
<globalStatsLink></globalStatsLink>
</game>
</games>
</gameslist>
I'm trying to get the 'name' and 'appID' sections of the XML. There will be up to 200+ items in the list.
I tried doing
foreach($xml->children() as $child)
echo $child['name'];
and it didn't work.
I've never worked with PHP in this way, so I have literally no idea how or what way to start this.
No comments:
Post a Comment