Validating phone number php
Now that you’ve defined the form in HTML, let’s identify the two stages the form goes through – when the blank form is loaded, and when the user has completed the form and clicks the submit button.
We used “@” in case if the variable is not set, it won’t show any error.
As server side form validation is done on server, the submitted data is validated and cleaned by server and then it is used.
No one can modify those data without having access to the server. If you want, you can use get method, just change method=”get” and replace $_POST with $_GET – that’s all.
Select the list of cells that you want to only type with the specific phone number format, and then right click, choose Format Cells form the context menu, see screenshot: 2.
In the Format Cells dialog box, under the Number tab, click Custom from the left Category pane, and then enter the phone number format as you need into the Type text box, in this example, I will use this is the first cell of the column that you want to validate the phone number. And then click OK button, now, when you enter a 10 digits number, it will be converted to the specific phone number format automatically as you need, see screenshot: 7.