validate phone numbers
| From: | Richard Kurth | Date: | Wed, 20 Jun 2001 02:24:08 +0000 |
| Subject: | validate phone numbers | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-54441@lists.php.net to get a copy of this message | ||
I am using this script to validate for phone numbers and it work just
perfect for US phone numbers. But it rejects some European and
Australian numbers what do I need to do to make it validate all phone
numbers
if (($WPHONE_NO) || ($wphone_no)) {
$wphone_no = trim($wphone_no);
if ($WPHONE_NO)
$phone_no = trim($WPHONE_NO);
if (!ereg("(^(.*)[0-9]{3})(.*)([0-9]{3})(.*)([0-9]{4}$)", $wphone_no)) {
print_error("your <b>phone number</b> is invalid");
}
}
Best regards,
Richard
mailto:rkurth@pacifier.com