PHP code example of danielme85 / laravel-cconverter
1. Go to this page and download the library: Download danielme85/laravel-cconverter 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/ */
danielme85 / laravel-cconverter example snippets
//To convert a value
$valueNOK = Currency::conv($from = 'USD', $to = 'NOK', $value = 10, $decimals = 2);
//To convert a value based on historical data
$valueNOK = Currency::conv($from = 'USD', $to = 'NOK', $value = 10, $decimals = 2, $date = '2018-12-24');
//to get an array of all the rates associated to a base currency.
$rates = Currency::rates(); //defaults to USD
$rates = Currency::rates('NOK');
//Get historical rates
$rates = Currency::rates('NOK', '2018-12-24');