Exemplo n.º 1
0
<?php

require '../vendor/autoload.php';
$converter = new CurrencyConverter\CurrencyConverter();
echo $converter->convert('USD', 'NPR');
// or you can do $amount =  $converter->convert(array('country' => 'US'), array('country' => 'NP'));
<?php

require '../vendor/autoload.php';
$converter = new CurrencyConverter\CurrencyConverter();
// Via factory:
$zendCache = Zend\Cache\StorageFactory::factory(array('adapter' => array('name' => 'Filesystem', 'options' => array('ttl' => 10, 'cache_dir' => __DIR__ . '/cache'))));
$cacheAdapter = new CurrencyConverter\Cache\Adapter\ZendAdapter($zendCache);
$converter->setCacheAdapter($cacheAdapter);
echo $converter->convert('USD', 'NPR');