Yii 1.1: ar-php

Arabic Language in PHP, a general purpose library which is rich and useful to deal with Arabic.

بسم الله الرحمن الرحيم

ar-php extension is a wrapper extension to the great library Ar-PHP which is developed by Khaled Al-Sham'aa

Note: using the library directly as a vendor without using an extension is better but the problem is that we should modify a file in the library to make it work and i preferred not to touch the lib files. (maybe i will make a wiki to explain how)

Library Features


This extension developed using Yii version 1.1.14 RC but it is has been tested up to version 1.1.16.


1) download and extract the extension into extensions folder: protected/extensions/ar-php

2) download the library from here (tested on version 3.6.0 of this library).

3) extract the library into Your-Application-Folder/vendor , example:


4) configure component by updating config/main.php as follow:

        'libPath'=>'application.vendor.I18N' // optional since it is the default value


I tried to make the usage of the extension as easy as i can, in the official website there is an example of usage and it will not work for our extension but it will help us to compare between them, which is:

$obj = new I18N_Arabic('Numbers');
echo $obj->int2str(1975); // ألف و تسعمئة و خمس و سبعون

to generate the same example using ar-php extension use:

$obj = Yii::app()->I18N_Arabic->Numbers;
echo $obj->int2str(1975); // ألف و تسعمئة و خمس و سبعون

or simply:

echo Yii::app()->I18N_Arabic->Numbers->int2str(1975); // ألف و تسعمئة و خمس و سبعون

the same concept apply for all other features, and you can follow any feature link above for documentation and usage example.


Total 2 comments

#14282 report it
Muaid at 2013/08/01 07:19am
glad to see it useful

أسعدتني لانها كانت مفيدة لك

وشكرا على الدعم


#14225 report it
zqrt at 2013/07/27 08:16pm
thank you

this is what i need :)

great work

شكرا لك

Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: Muaid
  • Category: Others
  • Votes: +4
  • Downloaded: 205 times
  • Created on: Jul 26, 2013
  • Last updated: Jan 31, 2015
  • Tags: I18N, arabic