PHP code example of thelia / currency-converter

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

    

thelia / currency-converter example snippets


$baseValue = new \Thelia\Math\Number('1');

$convertedValue = $currencyConverter
    ->from('EUR')
    ->to('USD')
    ->convert($baseValue);
    
echo $baseValue->getNumber(); //1.24