从url获取JSON并回显数据时出现小错误

时间:2016-02-14 11:48:30

标签: php arrays json

让我们说,我的网址是

$priceURL = "http://steamcommunity.com/market/priceoverview/?currency=1&appid=570&market_hash_name=Genuine%20Bloodfeather%20Wings"

$priceArray = file_get_contents($priceURL);
$priceArray = json_decode($priceArray, true);

$lowest = $priceArray['lowest_price'];

echo $lowest;

网址中的JSON是:

{"success":true,"lowest_price":"$6.63","volume":"169","median_price":"$6.51"}

但我收到了未定义索引的错误。是因为我错误地指向了Lowest_price吗?

谢谢堆

0 个答案:

没有答案