Re: Phone number validation
| From: | Richard Baskett | Date: | Sun, 07 Apr 2002 03:55:00 +0000 |
| Subject: | Re: Phone number validation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91901@lists.php.net to get a copy of this message | ||
What I do is strip all non-numeric numbers out and just store the number as
a string of numbers.. Then do validation on those numbers.. Make sure the
right amount of numbers are there, valid country, city codes etc. Probably
an easier approach :)
Rick
Nothing is more common than unsuccessful men with talent. Genius will not;
unrewarded genius is almost a proverb. Education alone will not; the world
is full of educated derelicts. Persistence and determination alone are
omnipotent." - Calvin Coolidge
> From: "Jason Cribbins" <phplist@kibserv.org>
> Reply-To: "Jason Cribbins" <phplist@kibserv.org>
> Date: Sat, 6 Apr 2002 22:47:46 -0500
> To: <php-general@lists.php.net>, "Gary" <garyb10@earthlink.net>
> Subject: Re: [PHP] Phone number validation
>
> Some people use period '.' in between fields...me for one. Its an old habit
> I have although I forget where I picked that up from. I am sure it was when
> I was working overseas...maybe Asia where I saw all phone numbers using .
> between fields.
>
> ----- Original Message -----
> From: "Gary" <garyb10@earthlink.net>
> To: <php-general@lists.php.net>
> Sent: Saturday, April 06, 2002 8:52 PM
> Subject: [PHP] Phone number validation
>
>
> : Hi All,
> : I tried to cut a corner and use an alphabetic validation I am using
> : elsewhere
> : $stuff = "/^[a-zA-Z]+$/";
> : if(preg_match($stuff, $value))
> :
> : looks like I forgot about +( )- being in phone number. What is the
> : easiest way to allow these 4 characters? Are there any other characters
> : that people use?
> :
> : TIA
> : Gary
> :
> :
> : --
> : PHP General Mailing List (http://www.php.net/)
> : To unsubscribe, visit: http://www.php.net/unsub.php
> :
> :
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>