I've been tasked with parsing and displaying an XML file using PHP, sounds worse than it is but I'm stumped by something in the format of the actual XML file
The PHP is simple enough:
However, it only shows the "description", not the ID, the XML file is in the format:
<property id="xx">
<description>blah blah blah</description>
</property>
if the ID was it's own seperate element it'd show no problem but because it's in that top tag, it doesn't.
I know one of you genius's will look at it and laugh
The PHP is simple enough:
Code:
<?php
$xmlFileData = file_get_contents("data.xml");
$xmlData = new SimpleXMLElement($xmlFileData);
foreach($xmlData->property as $test) {
print($test->id) . "<br><br>";
print($test->description) . "<br><br>";
}
?>
However, it only shows the "description", not the ID, the XML file is in the format:
<property id="xx">
<description>blah blah blah</description>
</property>
if the ID was it's own seperate element it'd show no problem but because it's in that top tag, it doesn't.
I know one of you genius's will look at it and laugh
