PHP code example of jrsaunders / exchangerates

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

    

jrsaunders / exchangerates example snippets

 

$cache = new \ExchangeRates\Cache();

$cache->setCachePath('/var/www/vhost/my-site/cachedata/');

$conversion = new \ExchangeRates\Conversion('GBP', 'EUR', 10.34);
   
echo $conversion->get();

// will echo out 11.70 - converting GBP 10.34 to EUR 11.70