Validating phone numbers

Associate
Joined
30 Dec 2005
Posts
415
Does anyone have any well tested methods for validating phone numbers on websites?

Up till now, i've been using the following regular expression in PHP:

Code:
if (!ereg("^\s*\(?(020[7,8]{1}\)?[ ]?[1-9]{1}[0-9{2}[ ]?[0-9]{4})|(0[1-8]{1}[0-9]{3}\)?[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{3})\s*$",$phonehomecontact)) {

but just discovered two phone numbers do not work:
01949 12345
0116 1234567


Does anyone else have any regular expressions which do the job, or another method?

Cheers,
Rich
 
i was thinking that!! i've productively used about 6 links he's posted in the last week. he'll make a great blagger's assistant.

does anyone think they're up to the challenge of coding "virtual Beansprout"?? i could do with a Java version for my phone
 
I'm pretty sure you can get Google on a phone :cool: :D

I pick up links across my travels, especially links linked to from links linked to by Augmented and, well, any forum posts I see which look useful :)
 
Back
Top Bottom