PHP code example of sw-ffm / ecb-exchange-rates

1. Go to this page and download the library: Download sw-ffm/ecb-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/ */

    

sw-ffm / ecb-exchange-rates example snippets




use EcbExchangeRates\EcbExchangeRates;

ata
echo $ezb_rates->exchange_rates_json . PHP_EOL;

// Array-Data
var_dump($ezb_rates->exchange_rates_array);

// Cache Data
/* $caching_file = __DIR__ . '/cache/DailyExchangeRates.json';
if($caching_file){
    if($ezb_rates->cacheData($caching_file)){
        echo "File saved";
    }
}  */