C
C#3y ago
SR1909

✅ Best way to save or normalize phonenumber

I want to save a phonenumber into my DB. But user use sometimes other notations... How do I normlalize this in the most efficient way?
3 Replies
Pendramon
Pendramon3y ago
You'd have to have client side and server side validation that validates that the phone number is in correct format. There may be a library out there to validate all country codes but I think a simple fool proof plan would be to accept all of them as long as the phone number is conforming to a format (ex: E.164 format) and just send a verification code to the user to confirm that the number is correct.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
SR1909
SR1909OP3y ago
Thanks! Going to check it

Did you find this page helpful?