There is no license information available for the latest version (1.0) of this package.

Library to convert Latin numbers to Arabic and vice versa

1.0 2017-07-23 16:09 UTC

This package is auto-updated.

Last update: 2023-11-27 12:08:05 UTC



بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ

Arabic Numbers

This library helps convert between latin and arabic numerals and vice versa.


To install:

composer require meezaan/arabic-numbers


To use the library in your apps, make sure the composer autoload file is already included. Then:

use ArabicNumbers\Numbers;

// Latin to Arabic
$arabic = Numbers::latinToArabic(157); // returns ١٥٧

// Arabic to latin
$latin - Numbers::arabicToLatin(١٥٧); // returns 157

// Arabic to HTML
$html = Numbers::ArabicToHtml(١٥٧); // returns ١٥٧

Unit Tests

These are included in the tests folder. To run them, make sure you've already run composer install. Then:

php vendor/bin/phpunit --bootstrap vendor/autoload.php tests/

Happy days.