PHP code example of rupeshpoonia / gmail-phn-validation

1. Go to this page and download the library: Download rupeshpoonia/gmail-phn-validation 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/ */

    

rupeshpoonia / gmail-phn-validation example snippets


use rupeshpoonia\ValidEmail;

$email = '[email protected]';
if (ValidEmail::validate('email', $email)) {
    echo 'Valid email address.';
} else {
    echo 'Invalid email address.';
} 

use rupeshpoonia\ValidPhoneNumber;

$phoneNumber = '+911234567890';
if (ValidPhoneNumber::validate('phone', $phoneNumber)) {
    echo 'Valid phone number.';
} else {
    echo 'Invalid phone number.';
}