Created
July 9, 2015 10:41
-
-
Save dmacompton/2ddee3ce86e2a2b4082a to your computer and use it in GitHub Desktop.
valid phone number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validate_phone($phone) | |
{ | |
$phone = preg_replace("/[^0-9]/",'',$phone); | |
if(empty($phone) || (strlen($phone) < 8 || strlen($phone) > 16)) | |
return false; | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment