PHP code example of oceanapplications / currencylayer-php-client

1. Go to this page and download the library: Download oceanapplications/currencylayer-php-client 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/ */

    

oceanapplications / currencylayer-php-client example snippets


composer 
 php
rrencylayer = new \currencylayer\client('YOUR_ACCESS_KEY');
 php
$result = $currencylayer
  ->source('USD')
  ->currencies('JPY,GBP,AUD')
  ->live();
 php
$result = $currencylayer
  ->date('2015-01-01')
  ->source('USD')
  ->currencies('JPY,GBP,AUD')
  ->historical();
 php
$result = currencylayer
  ->from('USD')
  ->to('JPY')
  ->amount('10')
  ->date('2015-01-01')
  ->convert();
 php
$result = $currencylayer
  ->source('USD')
  ->currencies('JPY,GBP,AUD')
  ->start_date('2014-01-01')
  ->end_date('2014-02-01')
  ->timeframe();
 php
$result = $currencylayer
  ->source('USD')
  ->currencies('JPY,GBP,AUD')
  ->start_date('2014-01-01')
  ->end_date('2014-02-01')
  ->change();