regex phone number validation with PHP

前端 未结 5 1159
孤独总比滥情好
孤独总比滥情好 2021-01-17 01:33

This is another question about a previous question I had asked yesterday. I want user to be allowed to type US phone numbers in the following formats.

(800)-555-121

5条回答
  •  攒了一身酷
    2021-01-17 02:02

    Re: Rohan Kumar's solution

    
    

    It does address the issue of fake phone numbers such as 800-123-2222. Real phone numbers have a first digit of at least "2". While the other solutions do the format correctly, they don't address the issue of people putting in phone numbers like 800-000-1234, which would be correct in the other solutions provided.

提交回复
热议问题