This question already has an answer here:
- Accessing @attribute from SimpleXML 8 answers
How can i, in php access the attributes values:
[photos] => SimpleXMLElement Object
(
[@attributes] => Array
(
[page] => 1
[pages] => 1
[perpage] => 24
[total] => 18
)
I have tried the following:
$photos->@attributes['total'] ;
$photos->{'@attributes'}['total'] ;
and many variations of this
Just
See Example #5 Using attributes