|Ratings|| ||Unique User Downloads|| ||Download Rankings|
|Not yet rated by the users||Total: 49 ||All time: 10,349 This week: 179|
This class can parse and validate Nigeria phone numbers.
It can take a string of given phone number from Nigeria and parses it to check if it is valid.
The class can also reformat the phone number string, return the area code name and phone carrier network name.
It can also check if a number contains the name network, as well get the network name by number prefix.
Nigerian Phone Number Validator (PHP)
Issues and pull requests welcome.
A Python module to validate and format a Nigerian phone number as well as deduce the network provider or area code.
Table of Contents
You will need PHP 7.x and composer.
Install using composer:
composer require djunehor/validate_nigerian_phone
$phone = new NigerianPhone('+2348135087966');
// Check if is valid
$phone->isValid(); // true
// Get formatted
$phone->formatted(); // 08135087966
// Get Network
$phone->getNetwork(); // mtn
// Check if is mtn
$phone->isMtn(); // True
// Get network from phone number prefix e.g
$phone->getNetworkByPrefix('0703'); // mtn
Run `phpunit tests/NigerianPhoneTest.php`
Check out the issues on GitHub and/or make a pull request to contribute!
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.