This is the output of print_r()
run on a typical SimpleXMLElement object:
SimpleXMLElement Object
(
[@attributes] => Array
(
)
)
What does the @ sign mean?
This is a SimpleXMLElement object. The '@attributes' row is an internal representation of the attributes from the XML element. Use SimpleXML's functions to get data from this object rather than interacting with it directly.
All those answers about error control are incorrect. The @ doesn't mean anything. That's how the property is called internally, but do not rely on this. Do not rely on print_r()
or var_dump()
when dealing with SimpleXML. SimpleXML does a lot of "magical" things that are not correctly represented by print_r()
and var_dump()
.
If you need to know what's "inside" a XML fragment, just use ->asXML()
on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With