Skip to content
eramhqPublic

About

Zero-runtime-dependency Persian (Farsi) utility toolkit for PHP 8.1+: validators (national ID, IBAN, bank card, phone), formatters (number-to-words, time-ago, ordinals), text utilities (slug, script detection, char normalization), and digit conversion.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Abzar

فارسی

Persian text, digits, number formatting, Iranian validators, and rial/toman money tools for PHP 8.1+. No third-party Composer packages are required at runtime. PHP's mbstring extension is required; intl is optional for Persian sorting and NFC normalization.

Install

composer require 'eram/abzar:^0.8.1'

Abzar remains pre-1.0 (0.x); minor releases may break compatibility. Release 0.8.1 has no prerelease suffix. The constraint above stays below 0.9. Review the stability policy before upgrading.

Quick start

Save as example.php next to vendor/ and run php example.php.

<?php
require 'vendor/autoload.php';

use Eram\Abzar\Validation\PhoneNumber;
use Eram\Abzar\Money\Amount;
use Eram\Abzar\Money\Currency;

$phone = PhoneNumber::from('+98 912 123 4567');
echo $phone->value(), "\n";
echo Currency::format(Amount::fromRials(12_345)), "\n";
09121234567
۱،۲۳۴.۵ تومان

Validation checks structure and, where applicable, checksums. It does not prove ownership, identity, account existence, or phone reachability.

Documentation

MIT; see LICENSE. Some algorithms and lookup tables derive from the MIT-licensed persian-tools project. See Contributing to help.

About

Zero-runtime-dependency Persian (Farsi) utility toolkit for PHP 8.1+: validators (national ID, IBAN, bank card, phone), formatters (number-to-words, time-ago, ordinals), text utilities (slug, script detection, char normalization), and digit conversion.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages