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
Contents
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.
I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I’m a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.