我從 eBay API 返回了這個。如何count使用 PHP 訪問這些值?( [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;
1 回答

哈士奇WWW
TA貢獻1799條經驗 獲得超6個贊
要查看所有屬性,請使用
foreach ($xml->searchResult->attributes() as $a=>$b) echo "[$a] = $b <BR>";
- 1 回答
- 0 關注
- 84 瀏覽
添加回答
舉報
0/150
提交
取消