I'm trying to come up with some code (PHP, but that's not important) to convert and validate any phone number that a user types in into an E.164 valid number.

Two questions:

1. is there a regex or description of what makes a valid E.164 number? All I can find is that the number needs to be in the following format

+AAA.BBBBBBBBBBBxCCCC

Where AAA is the country code, BBBBBBB is everything else (ie. area code + exchange + number), and xCCCC is the optional extension.

2. Anyone have any code to try and convert phone numbers typed in other formats into E.164?

- Colin

Reply via email to