PHPackages                             imahmood/persian-text - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. imahmood/persian-text

ActiveLibrary[Localization &amp; i18n](/categories/localization)

imahmood/persian-text
=====================

A lightweight library for persian language localization.

v2.0.0(2y ago)012.9kMITPHPPHP ^8.1

Since Apr 27Pushed 2y ago2 watchersCompare

[ Source](https://github.com/imahmood/persian-text)[ Packagist](https://packagist.org/packages/imahmood/persian-text)[ RSS](/packages/imahmood-persian-text/feed)WikiDiscussions main Synced 2mo ago

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

PersianText
===========

[](#persiantext)

[![Latest Stable Version](https://camo.githubusercontent.com/de416e0b385deb11e800c3fecd2a738a4d96dcb43648bbc5f5a84b9dfc0ac01e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696d61686d6f6f642f7065727369616e2d746578742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imahmood/persian-text)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9f1582858ac094b5501a106658341b71932b4b31be0683309283833259d6893b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696d61686d6f6f642f7065727369616e2d746578742f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/imahmood/persian-text/actions?query=workflow%3Atests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ca12dac208fb19158cff080fe3ac654c64d0b12cfb2291d7107e662a247fa76c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696d61686d6f6f642f7065727369616e2d746578742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imahmood/persian-text)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

PersianText is a lightweight library for persian language localization.

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

[](#requirements)

- PHP 8.1 or greater
- intl PHP extension

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

[](#installation)

You can install this package via Composer:

```
$ composer require imahmood/persian-text
```

Usage
-----

[](#usage)

```
$string = '0123456789 - ۰١٢٣٤٥٦٧٨٩ - ي ك ة';

echo PersianText::text($string);
output: ۰۱۲۳۴۵۶۷۸۹ - ۰۱۲۳۴۵۶۷۸۹ - ی ک ه

echo PersianText::onlyArabicChars($string);
output: 0123456789 - ۰۱۲۳۴۵۶۷۸۹ - ی ک ه

echo PersianText::onlyNumbers($string);
output: ۰۱۲۳۴۵۶۷۸۹ - ۰۱۲۳۴۵۶۷۸۹ - ي ك ة

echo PersianText::toEnglishNumber($string);
output: 0123456789 - 0123456789 - ي ك ة

echo PersianText::money('123456789');
output: 123٬456٬789

echo PersianText::asSpellout(123456);
output: صد و بیست و سه هزار و چهارصد و پنجاه و شش
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity74

Established project with proven stability

 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 ~984 days

Total

3

Last Release

975d ago

Major Versions

1.1 → v2.0.02023-09-17

PHP version history (2 changes)1.0PHP &gt;=5.4.0

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/40872fcebcb975a26597596c44e39a140269d1db23522b47831bfca04d3397f1?d=identicon)[imahmood](/maintainers/imahmood)

---

Top Contributors

[![imahmood](https://avatars.githubusercontent.com/u/13146816?v=4)](https://github.com/imahmood "imahmood (11 commits)")

---

Tags

farsipersianpersianfarsipersian stringpersian text

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/imahmood-persian-text/health.svg)

```
[![Health](https://phpackages.com/badges/imahmood-persian-text/health.svg)](https://phpackages.com/packages/imahmood-persian-text)
```

###  Alternatives

[sadegh19b/laravel-persian-validation

A comprehensive Laravel validation package for Persian text, numbers, dates, and Iranian national identifiers

18293.8k1](/packages/sadegh19b-laravel-persian-validation)[iamfarhad/validation

🇮🇷 Complete Laravel Persian validation package - Iranian national ID, mobile numbers, Shamsi dates, IBAN/Sheba, postal codes &amp; more. Modern Laravel 10-12 support with both ValidationRule objects &amp; string-based rules.

2917.3k](/packages/iamfarhad-validation)[opilo/farsi

Farsi Tools for Dates and Numbers and Strings (with Laravel Validation Support)

333.2k1](/packages/opilo-farsi)[symfony_persia/symfonyjdate

Jalali (Shamsi) DateTime for Symfony2, Supports year higher than 2038

1010.6k](/packages/symfony-persia-symfonyjdate)

PHPackages © 2026

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