validate phone numbers

From: Date: Tue, 19 Jun 2001 19:37:19 +0000
Subject: validate phone numbers
Groups: php.general 
Request: Send a blank email to php-general+get-54415@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

« previous php.general (#54415) next »