dev-master
9999999-devClass to detect the currency from any string
MIT
The Requires
- php >=5.4.0
Wallogit.com
2017 © Pedro PelĂĄez
Class to detect the currency from any string
Class to detect the currency from any string, support +100 currencies., (*1)
The recommended way to install CurrencyDetector is through composer. You can see the package information on Packagist., (*2)
{
"require": {
"mcuadros/currency-detector": "dev-master"
}
}
Returns a string with the most common currency., (*3)
$detector = new Detector();
echo $detector->getCurrency('11.10$');
//Returns: USD
Returns all the currencies suitable for this string., (*4)
$detector = new Detector();
echo $detector->getCurrencies('11.10$');
//Returns: ['USD', 'AUD', 'CAD', ...]
Return a money string as a float, (*5)
$detector = new Detector();
echo $detector->getAmount('11,10.00$');
//Returns: 1110.00
Tests are in the tests folder.
To run them, you need PHPUnit.
Example:, (*6)
$ phpunit --configuration phpunit.xml.dist
MIT, see LICENSE, (*7)
Class to detect the currency from any string
MIT