PHP code example of genderapi / phone-validator
1. Go to this page and download the library: Download genderapi/phone-validator 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/ */
genderapi / phone-validator example snippets
use GenderApi\PhoneValidator;
$validator = new PhoneValidator('YOUR_API_KEY');
$response = $validator->validate('+1 212 867 5309', 'US');
print_r($response);
validate(string $number, string|null $address = null): array
$validator->validate('2128675309', 'US');
bash
git clone https://github.com/GenderAPI/phone-validator-php.git
cd phone-validator-php
composer install