ameen-sarsour / ar-php
Clone of ar-php library
Installs: 34
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 1
Forks: 0
Open Issues: 0
Language:HTML
Requires
- php: >=5.4.0
- ext-simplexml: *
This package is not auto-updated.
Last update: 2025-07-09 12:57:29 UTC
README
This Library clone from ar-php, It is a powerfull library to support Arabic in PHP.
Installation
The preferred way to install this extension is through composer.
Either run
composer require ameen-sarsour/ar-php
Usage
Example Conver Hijri String to TimeStamp
use \ArPhp\Arabic;
$time = time();
$Arabic = new Arabic('StrToTime');
$str = '1 رمضان 1439';
$int = $Arabic->strtotime($str, $time);
$date = date('l dS F Y', $int);
echo "String: $str \n";
echo "TimeStamp: $int \n";
echo "Date: $date \n";
##Yii2
same Example
To use this extension, simply add the following code in your application configuration:
return [ //.... 'components' => [ 'strToTime'=>[ 'class' => \ArPhp\Arabic::class, 'library' => '{{name of library eg. strToTime}}' ], ], ];
You can then call the function :
$str = '1 رمضان 1439'; $int = \Yii::$app->strToTime->strtotime($str, $time); $date = date('l dS F Y', $int); echo "String: $str \n"; echo "TimeStamp: $int \n"; echo "Date: $date \n"; echo $message . "\n";
ArPHP Full Features
en | العربية | library name | Example Github link | Example Result |
---|---|---|---|---|
Arabic text auto summarization | التلخيص الآلي للنص العربي | AutoSummarize | Example | Result |
Advanced Arabic search (stem based) | بحث متقدم بالعربية (بدلالة ساق الكلمة) | Query | Example | Result |
Present dates in Arabic or Hijri | عرض التواريخ بالعربية أو الهجرية | Date | Example | Result |
Convert Hijri date into Unix timestamp | تحويل التاريخ الهجري إلى Unix timestamp | Mktime | Example | Result |
Parse Arabic textual datetime into timestamp | تحويل أي نص عربي يصف التاريخ إلى timestamp | StrToTime | Example | Result |
Transliterate English words in Arabic | الترجمة اللفظية للكلمات الإنجليزية بالعربية | Transliteration | Example | Result |
Transliterate Arabic words in English | الترجمة اللفظية للكلمات العربية بالإنجليزية | Transliteration | Example | Result |
Spell numbers in Arabic idiom | التفقيط: كتابة الأرقام العربية | Numbers | Example | Result |
Phonetically alike Arabic words | التشابه اللفظي للكلمات العربية | Soundex | Example | Result |
Arabic character set auto detection | التعرف الآلي على مجموعة المحارف العربية | CharsetD | Example | Result |
Identify Arabic in multi language documents | تمييز النصوص العربية في الوثائق المتعددة اللغات | Identifier | Example | Result |
Identify names & places in Arabic text | تحديد الأسماء والأماكن في النص العربي | WordTag | Example | Result |
Guess gender of Arabic names | تخمين جنس الأسماء العربية | Gender | Example | Result |
Convert keyboard language programmatically | تغيير لغة لوحة المفاتيح برمجيا | KeySwap | Example | Result |
Calculate the time of Muslim prayer | حساب أوقات صلاة المسلمين | Salat | Example | Result |
Compress string using Huffman-like coding | ضغط النصوص بشيفرة مشابهة لشيفرة هوفمان | CompressStr | Example | Result |
Standardize Arabic text | نسيق النصوص العربية | Standard | Example | Result |
Arabic stemmer | استخلاص ساق (جذر) الكلمة | Stemmer | Example | Result |
Arabic Cities List | قائمة المدن العربية | --- | Example | Result |
Informations about Arabic countries | معلومات عن الدول العربية | Example | Result | |
Arabic text normalisation | تسوية/توحيد النص العربي | Normalise | Example | Result |
Translate English words into Hieroglyphics | ترجمة الكلمات الإنجليزية إلى الهيروغليفية | Example | Result | |
Translate English words into Phoenician | ترجمة الكلمات الإنجليزية إلى الفينيقية | Example | Result |
ArPHP Official Site
For full documentation ar-php
License
GNU Lesser General Public License v3.0