1. Go to this page and download the library: Download amine-zhioua/degache-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
amine-zhioua / degache-php example snippets
use AmineZhioua\DegachePhp\Degache;
Degache::validatePhoneNumber('20123456'); // true
use AmineZhioua\DegachePhp\Validators\PhoneValidator;
PhoneValidator::validate('20123456'); // true
use AmineZhioua\DegachePhp\Degache;
Degache::validateCIN('12345678'); // true
Degache::validateCIN('99999999'); // false — must start with 0 or 1
use AmineZhioua\DegachePhp\Degache;
Degache::validateRIB('01123456789012345678'); // true — ATB
Degache::validateRIB('99123456789012345678'); // false — unknown bank code
$bank = Degache::getBankInfoFromRIB('08123456789012345678');
// $bank->code === '08'
// $bank->name === 'Banque Internationale Arabe de Tunisie'
use AmineZhioua\DegachePhp\Degache;
use AmineZhioua\DegachePhp\Enums\CarPlateType;
Degache::validateCarPlate('123 تونس 4567'); // true
Degache::validateCarPlate('RS 123 تونس'); // true
Degache::validateCarPlate('rs 123 تونس'); // true — normalized
// Restrict to one type
Degache::validateCarPlate('RS 123 تونس', type: CarPlateType::Standard); // false
// Strict mode: no normalization, exact Arabic text
use AmineZhioua\DegachePhp\Degache;
Degache::validatePostalCode('2001'); // true — Ariana
Degache::validatePostalCode('9999'); // false — well-formed but doesn't exist
use AmineZhioua\DegachePhp\Degache;
Degache::validateTaxID('1234567A/B/C/000'); // true
Degache::validateTaxID('1234567a/B/C/000'); // false — must be uppercase