<?php
$response = '{"status":{"timestamp":"2020-09-26T12:59:24.147Z","error_code":0,"error_message":null,"elapsed":13,"credit_count":1,"notice":null},"data":{"BTC":{"id":1,"name":"Bitcoin","symbol":"BTC","slug":"bitcoin","num_market_pairs":9251,"date_added":"2013-04-28T00:00:00.000Z","tags":["mineable","pow","sha-256","store-of-value","state-channels"],"max_supply":21000000,"circulating_supply":18500450,"total_supply":18500450,"is_active":1,"platform":null,"cmc_rank":1,"is_fiat":0,"last_updated":"2020-09-26T12:58:38.000Z","quote":{"USD":{"price":10707.7229962,"volume_24h":20866014910.9822,"percent_change_1h":-0.156013,"percent_change_24h":0.675761,"percent_change_7d":-2.97789,"market_cap":198097693905.04828,"last_updated":"2020-09-26T12:58:38.000Z"}}}}}';
$rate = json_decode($response,true);
#print_r($rate);
echo $rate['data']['BTC']['quote']['USD']['price'];
- Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- 10707.7229962
preferences:
137.53 ms | 407 KiB | 5 Q