I have this:
$xml = simplexml_load_file('test.xml');
print"<pre>";
print_r($xml);
It printout this:
SimpleXMLElement Object
(
[b] => SimpleXMLElement Object
(
[c] => SimpleXMLElement Object
(
[d] => 543
)
)
)
but when I type echo $xml["b"]["c"]["d"]; nothing happens
the
print_ris kind of misleading,actually the
$xmlis series/array of SimpleXmlElement objectsso
here is some reference you should take a look first
Additional to type casting,
because everything node inside the xml object is either
stringorintPHP will auto convert for numeric string to integer,
however, is clearer if you provide the type hinting