I am new to PHP and I am trying to build a joomla module that displays the current BTC Price. I am using this API: https://api.coindesk.com/v1/bpi/currentprice.json
I cannot find out how to access the USD and EUR "rate". This is where I am currently (ignore the var_dump, I used it to verify I was receiving data):
<?php
$curl_handle = curl_init();
$url = "https://api.coindesk.com/v1/bpi/currentprice.json";
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
$curl_data = curl_exec($curl_handle);
curl_close($curl_handle);
$response_data = json_decode($curl_data);
//var_dump($response_data);
$user_data = $response_data;
foreach ($user_data as $user)
{
foreach ($user as $key => $value)
{
echo $key;
echo "<br />";
}
}