Re: Phone number validation

From: Date: Sun, 12 Mar 2006 23:37:53 +0000
Subject: Re: Phone number validation
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-231821@lists.php.net to get a copy of this message
On 3/12/06, tedd <tedd@sperling.com> wrote: > > Paul: > > Also check out: > > http://www.weberdev.com/get_example-3605.html > > tedd > > > >Hi all, > > > >I am trying to validate phone numbers in a web form that I have > >created. I am using a regular expression to validate the phone > >number. It seems when I enter the phone number in the following ways > >I get errors > > > >(123) 456 7890 > >123 456 7890 > >(123) 456 - 7890 > >123 456-7890 > > > >I am using the ereg method in php to test the regular expression. > >Here is the Regular Expression that I am using to test against > >potential phone numbers > > > >$validPhone = "^([0-9]{3}[ ]*)?[0-9]{3}[ ]*[0-9]{4}$"; > > > >By the way The phone numbers are in US format. > > > >If anyone can help me with this I would really appreciate it. > > > >Thanks, > >Paul > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > -- One suggestion is to have 1 field for all countries, I believe the total is 23? +011-049-069-13788-1234 -------------------------------------------------------------------------------- > http://sperling.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html

« previous php.general (#231821) next »