Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

intuxicated/PersianChar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Persian Character conversion

Arabic Numbers

Replace Arabic numbers with Persian numbers

<?php
$res = PersianChar::ar_numbers('۱۲۳۴1234١٢٣٤')
// ۱۲۳۴1234۱۲۳۴

English Numbers

Replace English numbers with Persian numbers

<?php
$res = PersianChar::en_numbers('۱۲۳۴1234١٢٣٤')
// ۱۲۳۴۱۲۳۴١٢٣٤

Arabic/English Numbers

Replace both Arabic and English numbers with Persian numbers

<?php
$res = PersianChar::numbers('۱۲۳۴1234١٢٣٤')
// ۱۲۳۴۱۲۳۴۱۲۳۴

Letters

Replace none Persian character with Persian character. This method covers most character in Arabic character table.

<?php
$res = PersianChar::letters('ؠک مټن تﺴت')
// یک متن تست

Note that this method will also remove non printable characters like U+200F

Installation

Composer

php composer.phar require intuxicated/persian-text '~1.0@dev'

Raw PHP

git clone https://github.com/intuxicated/PersianChar.git

Remove namespace Intuxicated\PersianChar; if your code doesn't support php namespace

About

Persian Char Conversion

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages