Если объект начинается с @
, например:
SimpleXMLElement Object (
[@attributes] => Array (
[href] => qwertyuiop.html
[id] => html21
[media-type] => application/xhtml+xml
)
)
Вы должны использовать:
print_r($parent_object->attributes());
, потому что $parent_object->{'@attributes'}
или $parent_object['@attributes']
не будут работать .