I am sure I am being an idiot here, but something is not working correctly.
I’ve got this very basic code.
$Xml = simplexml_load_file($Url);
If I do a debug print of $xml it comes out like I expect it to. The XML looks like this, very simple
<Root>
<Error>
<ErrorNo>0</ErrorNo>
</Error>
</Root>
All I want to do is get the error number. So I have tried this, and it doesn’t return anything!
echo $Xml->Root->Error->ErrorNo;
What am I doing wrong!?
take out
Root… asRootbecomes the$Xmlelement