获得奇怪的击杀(TF2 + steam API

Get Strange kills (TF2 + steam API

我一直在尝试获取 tf2 中某个奇怪物品的击杀数,但我的结果总是返回空白。关于如何执行的任何线索?

这是我目前得到的:

$userBackpack = json_decode(file_get_contents($backpackURL), true);
<?php 
foreach($userBackpack['result']['items'] as $ind=>$item) 
{
  if($item['defindex'] == 999)
    { 
      $totalkills = $userBackpack['result']['items'][0]['attributes'][0]['defindex'];
      if($item['attributes'][0]['defindex'] == "214")
        {   
          echo $item['attributes'][0]['value'];
        }
    }
else { }
}

?>

214 是 API.

中怪杀落入的defindex
"attributes": [
                    {
                        "defindex": 189,
                        "value": 1093664768,
                        "float_value": 11
                    },
                    {
                        "defindex": 211,
                        "value": 1424797755,
                        "float_value": 8132551507968
                    },
                    {
                        "defindex": 214,
Looking for S kills  -->`"value": 1000,
                        "float_value": 1.4012984643248171e-042
                    }
              ]

关闭,解决了一个问题。

致需要帮助的人 使用阀门 JSON 值 http://steamcommunity.com/id/{自定义网址}/inventory/json/730/2 然后 foreach rgDescriptions 得到 "type" 这是 kills.