Search code examples
phpsimplexml

"At sign" @ in SimpleXML object?


This is the output of print_r() run on a typical SimpleXMLElement object:

SimpleXMLElement Object
(
    [@attributes] => Array
        (

        )
)

What does the @ sign mean?


Solution

  • 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.