validate phone number php code example
Example 1: php validate phone number
$phone = '000-0000-0000';
if(preg_match("/^[0-9]{3}-[0-9]{4}-[0-9]{4}$/", $phone)) {
// $phone is valid
}
Example 2: php program to validate phone number using regular expression
preg_match('/^[0-9]{10}+$/', $mobile)