If the number is not entered as it is in the template, it will produce an “Invalid Phone Number” message. The Validation checks the input submitted by the user. Then update the following routes into web.php file, as follow: Here we will show how you can integrate phone number validation with HTML5. The awesome language, PHP has numerous in-built functions to validate user inputs. We will implement the form validation in the contact form using the most popular jQuery validation plugin. ", and number of allowed decimals is 4. How to validate phone number using php.