PHP code example of taghwo / phone-number-validator-formatter-for-nigerian-phone-numbers
1. Go to this page and download the library: Download taghwo/phone-number-validator-formatter-for-nigerian-phone-numbers 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/ */
taghwo / phone-number-validator-formatter-for-nigerian-phone-numbers example snippets
sh
splitPhoneNumber() splits phone number into chunks based on criterai supplied, (null, 4)
sh
$phonenumber = new PhoneNumberRequest('/--dff/s07000000000');
$phonenumber
->setDigits('11,14')
->validateWithRange() ✅
->getCleanNumber()//07000000000;✅
->formatToIntPhoneNumber()//2347000000000;✅
->getPrefix()//070
->splitPhoneNumber(null, 3);//[070,000,000,00];