I have the following code that converts, for example, 14,000 into BTCs that would give 1.07481682 , but I also wanted to do the reverse path for this guy, transform the 1.07481682 in BTC for 14,000 real. How could I do this?
$url = "https://bitpay.com/api/rates";
$json = file_get_contents($url);
$data = json_decode($json, TRUE);
$bitcoin_price = $data[30]["rate"];
$brl_value = 14000;
$value_bitcoin = round($brl_value / $bitcoin_price, 8);
echo '<pre>';
var_dump($value_bitcoin);
echo '</pre>';
die();