我从eBay API返回了此信息。如何使用PHP访问count
中的值?
(
[ack] => Success
[version] => 1.13.0
[timestamp] => 2020-04-13T00:01:52.128Z
[searchResult] => SimpleXMLElement Object
(
[@attributes] => Array
(
[count] => 0
)
)
...
我尝试了以下操作,但无济于事
$x->searchResult->@attributes->count;
$x->searchResult['@attributes']->count;
查看所有属性使用
foreach ($xml->searchResult->attributes() as $a=>$b)
echo "[$a] = $b <BR>";