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:
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
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