PHP code example of lilessam / currencies

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

    

lilessam / currencies example snippets


// This will convert 10 from USD to EUR with today's price
$amount = convert_currency(10, 'USD', 'EUR');

// This will return an object of all USD currencies today's rates
$rates = get_rates('USD');
// This will return an object of Euro, Indian Rubles and Arab Emirates Dirham rates for USD.
$rates = get_rates('USD', ['EUR', 'INR', 'AUD']);
bash
php artisan vendor:publish --provider=Lilessam\Currencies\CurrenciesServiceProvider