PHPackages                             mcuadros/currency-detector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mcuadros/currency-detector

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

mcuadros/currency-detector
==========================

Class to detect the currency from any string

1626.4k↓75%6PHP

Since Aug 28Pushed 8y ago2 watchersCompare

[ Source](https://github.com/mcuadros/currency-detector)[ Packagist](https://packagist.org/packages/mcuadros/currency-detector)[ RSS](/packages/mcuadros-currency-detector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

CurrencyDetector [![Build Status](https://camo.githubusercontent.com/82000c0fd85ed82de01f563f66111c8fd9600fa5716b8f1a66dcb7b3a085e7c7/68747470733a2f2f7472617669732d63692e6f72672f6d63756164726f732f63757272656e63792d6465746563746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mcuadros/currency-detector)
==============================================================================================================================================================================================================================================================================================================================

[](#currencydetector-)

Class to detect the currency from any string, support +100 currencies.

Requirements
------------

[](#requirements)

- PHP 5.4.x

Installation
------------

[](#installation)

The recommended way to install CurrencyDetector is [through composer](http://getcomposer.org). You can see [the package information on Packagist.](https://packagist.org/packages/mcuadros/currency-detector)

```
{
    "require": {
        "mcuadros/currency-detector": "dev-master"
    }
}
```

Usage
-----

[](#usage)

### getCurrency

[](#getcurrency)

Returns a string with the most common currency.

```
$detector = new Detector();
echo $detector->getCurrency('11.10$');
//Returns: USD
```

### getCurrencies

[](#getcurrencies)

Returns all the currencies suitable for this string.

```
$detector = new Detector();
echo $detector->getCurrencies('11.10$');
//Returns: ['USD', 'AUD', 'CAD', ...]
```

### getAmount

[](#getamount)

Return a money string as a float

```
$detector = new Detector();
echo $detector->getAmount('11,10.00$');
//Returns: 1110.00
```

Tests
-----

[](#tests)

Tests are in the `tests` folder. To run them, you need PHPUnit. Example:

```
$ phpunit --configuration phpunit.xml.dist

```

License
-------

[](#license)

MIT, see [LICENSE](LICENSE)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1573114?v=4)[Máximo Cuadros](/maintainers/mcuadros)[@mcuadros](https://github.com/mcuadros)

---

Top Contributors

[![mcuadros](https://avatars.githubusercontent.com/u/1573114?v=4)](https://github.com/mcuadros "mcuadros (12 commits)")[![AbadonnaAbbys](https://avatars.githubusercontent.com/u/17592321?v=4)](https://github.com/AbadonnaAbbys "AbadonnaAbbys (1 commits)")

### Embed Badge

![Health badge](/badges/mcuadros-currency-detector/health.svg)

```
[![Health](https://phpackages.com/badges/mcuadros-currency-detector/health.svg)](https://phpackages.com/packages/mcuadros-currency-detector)
```

###  Alternatives

[qruto/laravel-wave

Painless Laravel Broadcasting with SSE.

87048.4k](/packages/qruto-laravel-wave)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
