PHP code example of chandachewe / currency

1. Go to this page and download the library: Download chandachewe/currency 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');

/* Start to develop here. Best regards https://php-download.com/ */

    

chandachewe / currency example snippets


  use Chandachewe\Currency\DriverAccessKeys\ExchangeRateDriverAccessKey; 
 use Chandachewe\Currency\Drivers\ExchangeConverter;
 use Chandachewe\Currency\Drivers\ExchangeRate;
 use Chandachewe\Currency\CurrencyConverted;
 use Chandachewe\Currency\CurrencyFormats;
 

ExchangeRateDriverAccessKey::$exchangerate_access_key = 'YOUR ACCESS KEY HERE';
ExchangeConverter::convert('amount', 'from this currency', 'to this currency');

ExchangeRateDriverAccessKey::$exchangerate_access_key = 'YOUR ACCESS KEY HERE';
echo ExchangeConverter::convert(10, 'USD', 'GBP');

echo CurrencyConverted::$currency_conversion 

ExchangeRateDriverAccessKey::$exchangerate_access_key = 'YOUR ACCESS KEY HERE';
ExchangeRate::exchange('from this currency', 'to this currency');

ExchangeRateDriverAccessKey::$exchangerate_access_key = 'YOUR ACCESS KEY HERE';
echo ExchangeRate::exchange('USD', 'GBP');

echo CurrencyConverted::$currency_rate;