Bitcoin Helper is a PHP class that contains function(s) useful when dealing with Bitcoin integration into a website or web application.
About Bitcoin Helper
Over the past few months, I’ve become quite interested in the crypto-currency Bitcoin. I am therefore starting this mini-project with the aim of creating a class that will aid website developers that wish to integrate Bitcoin into their PHP powered website.
Bitcoin Helper development will be ongoing and I will update this project page as new features, fixes and changes occur.
Features of Bitcoin Helper
- Conversion of many common non Bitcoin currencies to Bitcoin using weighted 24 hour prices. Thanks go out to the public API of bitcoincharts.com for this data.
- Built in caching of external data, such as the JSON prices retrieved from the Bitcoin charts API, to reduce requests to external services.
Usage Instructions
To use Bitcoin Helper is simple. Here are step by step instructions on how to use the Bitcoin Helper PHP class.
Converting non Bitcoin currencies to Bitcoin
- Include/require the Bitcoin helper class file.
- Create a Bitcoin helper object.
- Call the object’s convert_to_btc($currency_code, $amount) function, passing the ISO 4217 formatted currency code and the amount of this currency you wish to convert.
Example code:
include "bitcoin_helper.php";
$bh = new bitcoin_helper;
echo $bh->convert_to_btc("GBP", 10);
This example code will output how much £10 (Great British Pounds, GBP) is in Bitcoins based on weighted averages over the past 24 hours.
Download Bitcoin Helper
To download the latest version of the Bitcoin Helper PHP class, click the link below.
Older Versions
There are currently no older version of Bitcoin Helper. When a new version is released, old versions will be migrated to this section.
Pingback: Bitcoin Helper 0.1 – Converting currencies to Bitcoin | Jordan Hall
Pingback: Bitcoin Helper 0.11 – Error handling and exchange rate caching | Jordan Hall