PHP code example of tawba / currency-converter

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

    

tawba / currency-converter example snippets


php index.php list
php index.php convert

use Tawba\CurrencyConverter\ConverterService;

$from_currency = "USD";
$to_currency   = "EGP";
$amount        = 1000;

$converter = new ConverterService(); // You can pass "google" or "yahoo" as a service API
echo $converter->convert($from_currency, $to_currency, $amount);