khaled.alshamaa/ar-php
Ar-PHP is a PHP library for Arabic language processing: text shaping and normalization, transliteration, date/hijri handling, numbers-to-words, and other Arabic-specific utilities. Useful for Arabic web apps, reports, and localization.
Copyright © 2006-2025 Khaled Al-Sham'aa.
Welcome to Ar-PHP, an open-source PHP library dedicated to simplifying Arabic language processing. Our mission is to provide developers with easy-to-use tools for professional searching, manipulating, and presenting Arabic text, enabling the creation of robust web applications that handle Arabic content effectively.
Internet use has grown quickly worldwide, especially in non-English speaking regions. Between 2000 and 2022, Arabic was the fastest-growing language online, increasing by 9,350%. It has around 240 million active users, making up 5.2% of internet users globally. This growth has created a demand for better Arabic web development tools, but most existing resources are geared toward English-speaking users.
[Arabic language, Internet world stats]
PHP is a widely used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. PHP runs more than 75% of all the top 10 million worldwide websites; a few very good examples are Facebook and Wikipedia.
[PHP language, Server-side languages report]
The key difference between the GPL and LGPL is that the LGPL allows a library to be linked to, or used by, a program that is not licensed under the (L)GPL. This means the program can be either free or proprietary software. If the program is not a derivative work of the library, it can be distributed under any license or terms chosen by its creator.
Alshamaa, Khaled (2008). PHP واللغة العربية. Dar Shoaa. Retrieved from https://darshoaa.com/pHP-and-Arabic-language/.
Ar-PHP has been successfully integrated into several projects, including:
To install this package using Composer, run the following command in your terminal:
composer require khaled.alshamaa/ar-php
Ensure that the Composer autoloader is included in your project. If your project already uses Composer's autoloading mechanism -like frameworks such as Laravel- you can skip this step. Otherwise, add the following line early in your project's initialization code:
require 'vendor/autoload.php';
Download the latest Ar-PHP release, extract it into your project directory, and include the library by adding:
require_once 'ar-php/src/Arabic.php';
Ensure the path matches the location of the Arabic.php file relative to your script.
We welcome contributions from the community! Whether it is reporting bugs, suggesting new features, or submitting pull requests, your help is valuable. Before contributing, please review our project logistics and TODO list for current tasks and priorities. If you are migrating from an older version, check out our UPGRADE guide to ensure a smooth transition. No matter what your skills and interests are, there is a place where you can participate in improving the Ar-PHP project:
As the developers of the Ar-PHP project, we can help your company leverage the maximum power of Ar-PHP to achieve your business goals. We offer professional services that span the full life cycle of Ar-PHP implementation.
If you would cite it in academic work, you can use this citation
K. Al-Shamaa, Ar-PHP, PHP library for website developers to process Arabic content,
https://github.com/khaled-alshamaa/ar-php, 2025
or in bibtex format
@misc{ar-php,
title={Ar-PHP, PHP library for website developers to process Arabic content},
author={Al-Shamaa, Khaled},
url={https://github.com/khaled-alshamaa/ar-php},
version = {7.0.0},
year={2025}
}
How can I help you explore Laravel packages today?