AbzarPHPOpen source · MIT

Persian details.
Taken care of.

The everyday essentials for Persian applications. Clean up text, check Iranian inputs, and handle money—with a consistent PHP toolkit.

composer require eram/abzar:^0.8@beta

REAL TASKS. ACTUAL LIBRARY OUTPUT.

See where Abzar fits.

Guided examples

Accept different formats. Keep one consistent number.

People type Persian digits, paste +98 numbers, or add spaces. Validate the input, then use a consistent value in your application.

Input

Customer contact details

Phone number entered by the customer
۰۹۱۲ ۱۲۳ ۴۵۶۷

A sample contact field. Compare different ways of entering a number.

Abzar output

Returned by the library

From input to useful output.

Reveal the result to see what Abzar returns for this exact example.

PHP for this exact example
use Eram\Abzar\Validation\PhoneNumber;

$result = PhoneNumber::validate('۰۹۱۲ ۱۲۳ ۴۵۶۷');
$result->isValid();
$result->errorCodes();
$result->warningCodes();

$phone = PhoneNumber::tryFrom('۰۹۱۲ ۱۲۳ ۴۵۶۷');
$phone?->value();
$phone?->e164();

Validation checks structure. It does not send an SMS or establish ownership.

Read the guide

Precomputed with Abzar’s PHP code. Choosing an example reveals its saved result; no PHP runs in your browser. Source snapshot

Text that reads naturally

Normalize characters and digits, create Persian slugs, and tidy up half-spaces.

Useful answers from your inputs

Check phone numbers, national IDs, cards, and IBANs. Get structured results and Persian error messages.

Amounts with their units attached

Work explicitly in toman or rial. Calculate, format, and write amounts in Persian words.

SMALL PACKAGE. PLENTY OF USES.

Fits into what you’re building.

Use Abzar in plain PHP or bring it into your framework. Start with one utility and reach for the others when you need them.

Explore the documentation
Requires
PHP 8.1+ · mbstring
Composer dependencies
None at runtime
License
MIT
Release channel
0.8 · Beta

Some Unicode and sorting features require intl. APIs may change before 1.0.