Hey there,
I have some xml, lets say <names number="12"></names>
When I run the following:
$simpleXMLElement = new SimpleXMLElement($xml);
pr($simpleXMLElement);
I get the following:
SimpleXMLElement Object
(
[@attributes] => Array
(
[number] => 12
)
[0] =>
)
It throws in that 0 entry. This is weird. I don't know what it's supposed to represent. If I do this instead:
<names number="12"><name first="oliver" /></names>
I get the following output:
SimpleXMLElement Object
(
[@attributes] => Array
(
[number] => 12
)
[name] => SimpleXMLElement Object
(
[@attributes] => Array
(
[first] => oliver
)
)
)
This is as expected (for me at least). Any thoughts/direction?