I have been trying to fetch some data from steam API which returns JSON such as this:
{"success":true,"lowest_price":"$2.76","volume":"345","median_price":"$2.60"}
However it does not return anything to the variable which is used somewhere else. It just shows 0.
Here's my JSON code, what am I doing wrong?
$steam1 = "http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=Chroma%20Case%20Key";
$json = file_get_contents($steam1);
$json_data = json_decode($json, true);
$median1= $json_data["median_price"];
$media1 = $median1 / '2.49';
Thanks for any help anyone can offer.
$so it can't be parsed as a number. You need to remove the$first.json_decode? Did you tryvar_dump($json_data)?