Ar-PHP
Arabic-aware search, text processing, and presentation toolkit for PHP.
Repository Health
Technical Analysis
Ar-PHP is a long-running open-source PHP library dedicated to Arabic language processing, giving developers ready-made tools for transliteration, Hijri calendars, spell checking, sentiment analysis, and other Arabic-specific text handling that’s otherwise hard to build from scratch in a mostly English-centric PHP ecosystem.
What You Get
- Arabic glyph shaping/rendering for correct right-to-left text display
- Hijri/Gregorian date conversion, Arabic strtotime, and prayer-time/Qibla calculation
- English-Arabic transliteration, Arabic Soundex, and gender guessing
- Arabic sentiment analysis, dialect identification, text summarization, and spell checking (SarahSpell)
Common Use Cases
- Building Arabic-language e-commerce, CMS, or survey sites that need correct RTL text rendering and search
- Converting between Gregorian and Hijri calendars for religious or regional applications
- Running lightweight Arabic sentiment analysis or dialect detection on user-generated content
- Generating Arabic-aware SQL queries and spelling out numbers in the Arabic idiom for invoices/reports
Under The Hood
Architecture - The bulk of functionality lives in a single large src/Arabic.php class (~5,600 lines) exposing one method per feature area (glyphs, dates, transliteration, sentiment, etc.), backed by data tables under src/data/; a separate SarahSpell.php class implements the Arabic spell checker feature. Tech Stack - PHP 5.6+ (PSR-4 autoloaded under ArPHP\I18N), depending on the calendar, mbstring, and zlib PHP extensions, dev-tested with PHPUnit 9; the project also ships a prebuilt .phar archive for non-Composer installs. Code Quality - Covered by tests/ArabicTest.php using PHPUnit; the project has run continuously since 2006 (PHP4 on PHPClasses.org, PHP5 on SourceForge, PHP7/8 on GitHub since 2020) and is adopted by several downstream open-source projects (Bagisto, Akeneo, LimeSurvey, Krayin), indicating real-world validation beyond its own test suite, though the single large class-file design concentrates a lot of surface area in one file. API Design - Nearly all functionality is accessed through instantiating one Arabic object and calling feature-specific methods (e.g. $obj->arabicGlyphs(), $obj->gDate()), which keeps discovery simple via the published API docs but means the class itself is very broad rather than composed of smaller focused collaborators.
Used by 3 apps in this directory
Bagisto
Analytics · Ecommerce
Open-source Laravel eCommerce platform for building multi-vendor marketplaces, B2B stores, headless commerce, and AI-powered storefronts.
Krayin CRM
Ecommerce · CRM
Free, open-source Laravel & Vue.js CRM for SMEs and enterprises to manage the complete customer lifecycle.
LimeSurvey
Forms Surveys
The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.