PHP code example of sedhossein / pregex

1. Go to this page and download the library: Download sedhossein/pregex 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/ */

    

sedhossein / pregex example snippets


use Sedhossein\Pregex\Pregex;

$false = (new Pregex)->IsPersianOrArabicNumber("123456"); // False, cause `123456` are english numbers
$true = (new Pregex)->IsPersianOrArabicNumber("۱۲۳۴۵۶");  // True, cause `123456` are persian numbers

function IsPersianNumber(string $number): bool;

function IsArabicNumber(string $number): bool;

function IsPersianOrArabicNumber(string $number): bool;

function IsEmail(string $email): bool;

function IsCellphone(string $number): bool;

function IsIban(string $value): bool;

function IsNationalCode(string $value): bool;

function IsCardNumber(string $value): bool;

function IsPostalCode(string $value): bool;

function IsPersianText(string $value): bool;