phone number validation in html form

Today, We want to share with you mobile number validation in php w3schools.In this post we will show you html phone number input, hear for 10 digit phone number validation in php we will give you demo and example for implement.In this post, we will learn about How To Allow Only 10 Digit Mobile Number Validation Using Javascript With Jquery with an example.

mobile number validation in html w3schools Code Example

Example 1:

The  defines a somefield for entering a telephone number. Note: Browsers that do not support "tel" fall back to being a standard "text" input. Tip: Always add the 

Example 2: Mobile number validation pattern in PHP

preg_match('/^[0-9]{10}+$/', $mobile)

call it in a function:

function validate_mobile($mobile)
{
    return preg_match('/^[0-9]{10}+$/', $mobile);
}

I hope you get an idea about html code for phone number format.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment