PHP code example of infinitypaul / naira-exchange-rates

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

    

infinitypaul / naira-exchange-rates example snippets

 php
$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->fetch();
 php
$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->addDateFrom('2019-11-26')->fetch();
 php
$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->setBaseCurrency('usd')->fetch();