Validates mobile numbers in Iran

Maintainers

Package info

github.com/Ali-kh333/persianValidator

Issues

pkg:composer/persian-validator/mobile

Statistics

Installs: 161

Dependents: 0

Suggesters: 0

Stars: 3

1.0.0 2018-07-01 12:17 UTC

This package is not auto-updated.

Last update: 2026-03-29 18:16:41 UTC


README

A simple class to validate mobile numbers in Iran.

Install

Via Composer

$ composer require persian-validator/mobile

Usage

Instantiate the class

$mobile = Mobile::make('0912000000');

Returns Boolean

$mobile->isValid();

Returns Boolean

$mobile->notValid(); 

Retruns Boolean

$moile->isIrancell(); 

Reruns the operator for the number

$mobile->operator(); 

If it's Hamrah aval, it returns the province for it. like Tehran, Isfahan ...

$mobile->province(); 

If mobile is valid returns nothing but if it's not valid Exception is thrown!

$mobile->validate();

License This library is released under the MIT license.