vajiral/simple-currency-converter

A light weight PHP class that can convert two currencies using exchangerate.guru API.

v1.0.1 2019-04-09 04:18 UTC

This package is auto-updated.

Last update: 2024-04-25 16:30:40 UTC


README

A light weight PHP class that can convert two currencies using exchangerate.guru API.

Usage:

Install via composer

"composer require vajiral/simple-currency-converter"

In your PHP file

<?php

use BigV\CurrencyCodes;
use BigV\CurrencyConverter;

require __DIR__ . "/../vendor/autoload.php";

$converter = new CurrencyConverter();
$converter->setCurrencyFrom(CurrencyCodes::ISO_USD);
$converter->setCurrencyTo(CurrencyCodes::ISO_LKR);
$converter->setAmount(10);

$result = $converter->convertCurrency();

?>