我正在尝试计算具有closed=1
和closed=0
我的目标是用1和0计算值,然后将其提取到两个不同的变量,如:
$countswithvalue1
$countswithvalue0
如何解决这个问题.-。
$url123 = 'http://steamcommunity.com/id/ProJaCore/stats/GarrysMod/?xml=1';
$data123 = file_get_contents($url123);
$elem = new SimpleXMLElement($data123);
foreach ($elem->achievements->xpath("achievement[@closed='1']") as $inha) {
print $inha->count().'----';
}
先谢谢你...你可以看一下xml - > http://steamcommunity.com/id/ProJaCore/stats/GarrysMod/?xml=1