When trying to parse an XML document in PHP, nothing is returned.
The XML document im trying to use:
The code I have tried:
$player = simplexml_load_file('http://ift.tt/1vRwpvt');
foreach ($player->PlayerName as $playerInfo) {
echo $playerInfo['firstName'];
}
I have also tried:
$player = simplexml_load_file('http://ift.tt/1vRwpvt');
echo "Name: " . $player->PlayerName[0]['firstName'];
What do I need to change for the attributes to show?
No comments:
Post a Comment