<分区>
我如何在 php 中访问属性值:
[photos] => SimpleXMLElement Object
(
[@attributes] => Array
(
[page] => 1
[pages] => 1
[perpage] => 24
[total] => 18
)
我尝试了以下方法:
$photos->@attributes['total'] ;
$photos->{'@attributes'}['total'] ;
以及它的许多变体