Jump to content

Question about phone numbers in forms


CincoPistolero

Recommended Posts

I have a form that asks for area code -111, and for phone number 999.1234 or 9991234 or 999-1234 and any other variation. What I'd like to do is take whatever they enter as a phone number and only send the numbers into the database - 9991234, that way I can use regular expressions when I pull it out to display it how I want. How do I go about stripping out the "." or "-" before inputting into db. Or is it easier to strip those out when I pull them from the db? Any direct code answers or links to pages containing tutorials or examples is much appreciated.

Link to comment
https://forums.phpfreaks.com/topic/140081-question-about-phone-numbers-in-forms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.