PHP code example of jimmerioles / bitcoin-currency-converter-php
1. Go to this page and download the library: Download jimmerioles/bitcoin-currency-converter-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
jimmerioles / bitcoin-currency-converter-php example snippets
bash
$ composer
php
use Jimmerioles\BitcoinCurrencyConverter\Converter;
$convert = new Converter;
echo $convert->toCurrency('USD', 0.5);
echo $convert->toCurrency('LTC', 0.5);
php
echo to_currency('USD', 0.5);
echo to_currency('LTC', 0.5);
php
use Jimmerioles\BitcoinCurrencyConverter\Converter;
$convert = new Converter;
echo $convert->toBtc(100, 'USD');
echo $convert->toBtc(20, 'LTC');
php
echo to_btc(100, 'USD');
echo to_btc(20, 'LTC');
php
echo to_currency('USD', 0.5, new CoindeskProvider);
echo to_currency('LTC', 0.5, new BitpayProvider);
echo to_btc(100, 'USD', new CoindeskProvider);
echo to_btc(20, 'LTC', new BitpayProvider);
php
new CoinbaseProvider($httpClient, $psr16CacheImplementation, 5);