PHP code example of fruitware / bnm
1. Go to this page and download the library: Download fruitware/bnm 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/ */
fruitware / bnm example snippets
// init client
$cacheDir = '/tmp/bnm'; // not );
// get rates on a specific date
$rates = $client->get(new DateTime());
// exchange 100 USD to MDL
$exchange = $rates->exchange('USD', 100, 'MDL');
// exchange 1000000 MDL to USD
$exchange = $rates->exchange('MDL', 1000000, 'USD');
// exchange 50000 EUR to MDL
$exchange = $rates->exchange('EUR', 50000, 'MDL');