function getPrice($url) {
$decode = file_get_contents($url);
return json_decode($decode, true);
}
$btcUSD = getPrice('https://api.kraken.com/0/public/Ticker?pair=XXBTZUSD');
$btcPrice = $btcUSD["result"]["XXBTZUSD"]["c"][0];
echo number_format (($btcPrice ), 2)." ". "USD" ;
?>
it follows Kraken market price for BTC if you want to do some changes in current price in USD dollars you can just write in ($btcPrice - or + how much you want to reduce or higher the price) and you are ready. It updates itself live and you have a ticker
I learned that PHP isn't the best and the most secure thing you could use.. Much better to keep up with technology and just use the javascript since it's a frontend language you could learn to use with other backend technologies