Was curious how to validate a phone number input field? Currently I am requiring that the phone # format be (5555555555) so that i can simply say if(is_numeric($phone_num))
so then when i retrieve it from DB i must manipulate the string to format it properly"(555)555-5555" But i was thinking it would be easier if there was a way to just validat the proper chars "(), and -" so that they can just type it in correctly and i can make sure they did so. Just wasn't sure how to validate with it having those extra chars "().and -" in the field. thanks for any input in advance, much appreciated. :)
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.