validate international phone numbers
| From: | Merlin | Date: | Tue, 02 Nov 2004 10:49:20 +0000 |
| Subject: | validate international phone numbers | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-200909@lists.php.net to get a copy of this message | ||
Hi,
I am trying to validate international phone numbers before adding into a db.
After a bit of research I came up with this regex:
return (ereg('^[0-9]{1,3}\.[0-9]{1,6}\.[0-9]{1,8}$', $phone));
However, this tightens the numbers to something like this: 409.711.933838
Thats a problem, since some countries have complete other formats and some peopole place a + in front and a : instead of . or even just the number.
Can anybody recommend a good regex to validate this? I am not to good at creating regex :-(
Thanx for any help,
Merlin