Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
Quote:
|
This code only ever displays the name attribute of the first player
|
Yep, but the first player of each <stats> element is different..
I don't know simpleXml, but my guess is that it builds an array of the <player> tags, and don't keep them in sync with their parent.
Which makes it just rubbish if it is the case.
Try to run this:
PHP Code:
<?php $xmlFileData = file_get_contents("match-10250605.xml"); $xmlData = new SimpleXMLElement($xmlFileData); foreach($xmlData->stats as $stats1) { var_dump($stats1); } ?>
it will dump the structure of each <stats> node.
From there, we will be able tho see what happens.
__________________
Only a biker knows why a dog sticks his head out the window.
|