0
Guys, I have the following code that converts for example 14,000 in real to BTC that would give 1.07481682, only that I also wanted to do this guy’s reverse way, turn the 1.07481682 in BTC to 14,000 real. How could I do that?
$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();
Man, thank you so much, you literally saved my life hahaha
– viniciussvl