Simple Tutorial - How to add your bitcoin wallet balance to your php website
Hello, today I show you how to add your bitcoin wallet balance on your website with a simple code but remember this only works with one single bitcoin address,
I installed Xampp server on my laptop and I'm also going to use wordpress for this tutorial.
So first of all you need to retrieve your balance from your bitcoin address for this tutorial I'm going to use blockchain.info's API here is the addrss :
https://blockchain.info/q/addressbalance/your-address
which is explained in here
https://blockchain.info/q
I have 0.2319 BTC in my wallet :
if you paste the above address in your browser you'll see this :
remember the number is not a float number so you have to multiply it by 0.00000001 (please correct me if I'm wrong cause this works for me).
Then we are going to use this php code to retrieve json data from blockchain.info's API :
<?php
$url = "https://blockchain.info/q/addressbalance/MY-ADDRESS here";
$json = file_get_contents($url);
$json_data = json_decode($json, true);
echo "<h1> My Balance: ". $json_data * 0.00000001 ."</h1>";
?>
here is my code :
and this is the final result :
Hi @hadif66 would u like to follow each other? congerlation to you for ur new exchanger. say Hello to @davidfar
thnks followed you
Congratulations! This post has been upvoted from the communal account, @minnowsupport, by hadif66 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews/crimsonclad, and netuoso. The goal is to help Steemit grow by supporting Minnows and creating a social network. Please find us in the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.
If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP. Be sure to leave at least 50SP undelegated on your account.
@OriginalWorks
The @OriginalWorks bot has determined this post by @hadif66 to be original material and upvoted it!
To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!