PHPackages                             itvisionsy/php-string-numbers - 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. itvisionsy/php-string-numbers

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

itvisionsy/php-string-numbers
=============================

A PHP class to convert from text to numbers and vice versa

v1.0.1(10y ago)0991MITPHPPHP &gt;=5.4.0

Since Mar 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/itvisionsy/php-string-numbers)[ Packagist](https://packagist.org/packages/itvisionsy/php-string-numbers)[ RSS](/packages/itvisionsy-php-string-numbers/feed)WikiDiscussions master Synced 3w ago

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

php-string-numbers
==================

[](#php-string-numbers)

A conversion class from text to numbers and vice versa

Install
=======

[](#install)

Using composer
--------------

[](#using-composer)

`composer require itvisionsy/php-string-numbers`

Direct download
---------------

[](#direct-download)

It is only 1 class! Copy and paste it or download it directly! [StringNumbers PHP Class](./src/StringNumbers.php)

How to use
==========

[](#how-to-use)

There are two public static methods

- `::numbersToWords($string)` converts all digits numbers to written numbers.
- `::wordsToNumbers($string)` converts all written numbers to word numbers.

Note
----

[](#note)

some space characters may get added or removed by the conversion method. Use with care!

Examples
========

[](#examples)

```
use ItvisionSy\StringNumbers\StringNumbers;

echo StringNumbers::wordsToNumbers('one hundred fifty five');
//155

echo StringNumbers::wordsToNumbers('There are two hundred fifty five thousand two hundred twelve leaves on the tree');
//There are 255212 leaves on the tree

echo StringNumbers::wordsToNumbers('Ten men bought 2 hundred devices in less than a week for more than two million dollars');
//10 men bought 200 devices in less than a week for more than 2000000 dollars

echo StringNumbers::numbersToWords('155');
//one hundred fifty five

echo StringNumbers::numbersToWords('There are 366 days in a leap year and 2016 was a leap year');
//There are three hundred sixty six days in a leap year two thousand sixteen was a leap year
```

License
=======

[](#license)

PHP String Numbers project is under the [MIT License](./LICENSE)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

3745d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/11ac511b34acf3f7e9a138d3b1a0a868303b376ab991bb176e8ea474857a0e57?d=identicon)[mhh1422](/maintainers/mhh1422)

---

Top Contributors

[![mhh1422](https://avatars.githubusercontent.com/u/499764?v=4)](https://github.com/mhh1422 "mhh1422 (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/itvisionsy-php-string-numbers/health.svg)

```
[![Health](https://phpackages.com/badges/itvisionsy-php-string-numbers/health.svg)](https://phpackages.com/packages/itvisionsy-php-string-numbers)
```

###  Alternatives

[medz/gb-t-2260

中华人民共和国国家标准 GB/T 2260 行政区划代码

10664.0k5](/packages/medz-gb-t-2260)[dipeshsukhia/laravel-country-state-city-data

Country State City Data Provider

8231.3k1](/packages/dipeshsukhia-laravel-country-state-city-data)

PHPackages © 2026

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