10 digit mobile number validation in php – how to validate 10 digit phone number?

10 digit mobile number validation in php – preg_match() checking it is integer or not and in strlen() it is checking no of digit in this string. Validate mobile number into 10 digit numbers in php jquery

10 digit mobile number validation in php

PHP preg_match for validating 10 digit mobile number

Regular expression

^[6-9][0-9]{9}$

$value = '99*7199871';
$mobileregex = "/^[6-9][0-9]{9}$/" ;  
echo "Welcome " . preg_match($mobileregex, $value) === 1;

php validate phone number

php 10 digit phone number validation

$contact = '000-0000-0000';

if(preg_match("/^[0-9]{3}-[0-9]{4}-[0-9]{4}$/", $contact)) {
  // $contact is valid
}

I hope you get an idea about 10 digit mobile number validation in php.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.