PHP code example of lok0613 / exchange-rates-api-io

1. Go to this page and download the library: Download lok0613/exchange-rates-api-io 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/ */

    

lok0613 / exchange-rates-api-io example snippets


use Lok0613\ExchangeRatesApiIo;
use Lok0613\ExchangeRatesApiIo\Currency;

$exchange_rates_api_io = new ExchangeRatesApiIo('access-token');
$rates = $exchange_rates_api_io->latestRates(new Currency('EUR'))->getRates();
$rates[0]->getCurrency()->getName(); // 'AED'
$rates[0]->getRate(); // 4.306