Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ojhaujjwal/currency-converter-php
Exchange rates/Currency Converter Library for PHP
https://github.com/ojhaujjwal/currency-converter-php
currency-converter-library currency-converter-php exchange-rate php
Last synced: 17 days ago
JSON representation
Exchange rates/Currency Converter Library for PHP
- Host: GitHub
- URL: https://github.com/ojhaujjwal/currency-converter-php
- Owner: ojhaujjwal
- License: mit
- Created: 2013-10-18T12:07:31.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T11:54:45.000Z (over 3 years ago)
- Last Synced: 2024-09-19T23:12:53.280Z (about 2 months ago)
- Topics: currency-converter-library, currency-converter-php, exchange-rate, php
- Language: PHP
- Homepage:
- Size: 103 KB
- Stars: 50
- Watchers: 6
- Forks: 20
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
currency-converter-php
======================[![Master Branch Build Status](https://api.travis-ci.org/ojhaujjwal/currency-converter-php.png?branch=master)](http://travis-ci.org/ojhaujjwal/currency-converter-php)
[![Latest Stable Version](https://poser.pugx.org/ujjwal/currency-converter/v/stable.png)](https://packagist.org/packages/ujjwal/currency-converter)
[![Latest Unstable Version](https://poser.pugx.org/ujjwal/currency-converter/v/unstable.png)](https://packagist.org/packages/ujjwal/currency-converter)
[![Total Downloads](https://poser.pugx.org/ujjwal/currency-converter/downloads.png)](https://packagist.org/packages/ujjwal/currency-converter)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ojhaujjwal/currency-converter-php/badges/quality-score.png?s=c4d93ce5c60894c09d2b4f7b1ec97d6956c9b23f)](https://scrutinizer-ci.com/g/ojhaujjwal/currency-converter-php/)
[![Code Coverage](https://scrutinizer-ci.com/g/ojhaujjwal/currency-converter-php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ojhaujjwal/currency-converter-php/?branch=master)Exchange rates/Currency Converter Library with features of caching and identifying currency from country code.
## Getting started
```php
convert('USD', 'NPR'); // will print something like 97.44// caching currency
$cacheAdapter = new CurrencyConverter\Cache\Adapter\FileSystem(__DIR__ . '/cache/');
$cacheAdapter->setCacheTimeout(DateInterval::createFromDateString('10 second'));
$converter->setCacheAdapter($cacheAdapter);
echo $converter->convert('USD', 'NPR');
```## Why Use It
* Reliable Rate, Uses [fixer.io](http://fixer.io/) API
* Caching of rate, to avoid connecting to fixer.io again and again
* Conversion without currency code(from country code)## Requirements
* PHP version 5.5 or later
* Curl Extension (Optional)## Installation
This library depends on composer for installation . For installation of composer, please visit [getcomposer.org](//getcomposer.org).Add `"ujjwal/currency-converter":"2.*"` to your composer.json and run `php composer.phar update`
## Usage
Please head on to [/examples](/examples) folder.For further documentation, please look at the [/docs](https://github.com/ojhaujjwal/currency-converter-php/tree/master/docs).