PHPackages                             vistag/price-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. vistag/price-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

vistag/price-parser
===================

Parse string and return separated price and currency

v1.0.2(8y ago)13.2k1[1 PRs](https://github.com/VistagGit/price-parser/pulls)MITPHPPHP ^5.4 || ^7.0

Since Mar 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/VistagGit/price-parser)[ Packagist](https://packagist.org/packages/vistag/price-parser)[ Docs](https://github.com/VistagGit/price-parser)[ RSS](/packages/vistag-price-parser/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

Price Parser
============

[](#price-parser)

Extract price and currency from given string

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

[](#installation)

You can install this package via composer using this command:

```
 composer require vistag/price-parser
```

Usage
-----

[](#usage)

```
use Vistag\PriceParser\PriceParser;

$priceParser = new PriceParser('120 Kč');

$priceParser->getPrice();
// 120
$priceParser->getCurrency();
// CZK

$priceParser = new PriceParser('$ 1,210,000.10');

$priceParser->getPrice();
// 1210000.1
$priceParser->getCurrency();
// USD

$priceParser = new PriceParser('foobar');

$priceParser->isValid();
// false

$priceParser = new PriceParser('12312');

$priceParser->isValid();
// true
$priceParser->getPrice();
// 12312
$priceParser->getCurrency();
// null
```

Support
-------

[](#support)

If you believe you have found an issue, please report it using the [GitHub issue tracker](https://github.com/VistagGit/price-parser/issues), or better yet, fork the repository and submit a pull request.

If you're using this package, I'd love to hear your thoughts. Thanks!

License
-------

[](#license)

The MIT License (MIT). [Vistag.com](https://vistag.com)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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.

###  Release Activity

Cadence

Every ~30 days

Total

3

Last Release

2932d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5340ba8a7477c30ad3bb88b15878a056228a0280182330f2d63c82bf6d2f1fdb?d=identicon)[vistag](/maintainers/vistag)

---

Top Contributors

[![rorecek](https://avatars.githubusercontent.com/u/6564004?v=4)](https://github.com/rorecek "rorecek (7 commits)")[![VistagGit](https://avatars.githubusercontent.com/u/35762264?v=4)](https://github.com/VistagGit "VistagGit (1 commits)")

---

Tags

currencyparserprice

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vistag-price-parser/health.svg)

```
[![Health](https://phpackages.com/badges/vistag-price-parser/health.svg)](https://phpackages.com/packages/vistag-price-parser)
```

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k902.6M1.8k](/packages/nikic-php-parser)[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M118](/packages/doctrine-lexer)[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

2.9k404.0M702](/packages/league-commonmark)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)

PHPackages © 2026

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