I have an XML file as follows:
<Main>
<SubMain>
<First>10570</First>
<Time>07:33:51</Time>
<Result>500</Result>
<Taken>8:14</Taken>
<Results>
<int>100</int>
<int>100</int>
<int>85</int>
<int>100</int>
<int>100</int>
<int>100</int>
<int>100</int>
</Results>
</SubMain>
</Main>
That I am loading from a file into PHP using simplexml_load_file:
$xml=simplexml_load_file("note.xml") or die("Error: Cannot create object");
foreach($xml->children() as $child)
{
echo $child->getName() . ": " . $child->First . $child->Time . $child->Taken ."<br>";
}
When I load in the Results row I am not getting any values returned, how do I step into this sub-array? Sorry if it's a daft question but has had me stumped today!
Edit: Removed the typo since it does not exist in the code, also to be clear the First, Time, Result etc are returning the expected values, it is the sub array (Results) I can not seem to pull data from.