Re: Need some coding help
| From: | Philip Olson | Date: | Sun, 15 Oct 2000 03:29:49 +0000 |
| Subject: | Re: Need some coding help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20203@lists.php.net to get a copy of this message | ||
if you are going to have 10 digit phone numbers then :
$value = preg_replace('/^(\d{3})(\d{3})(\d{4})/','(\\1)\\2-\\3',$value);
Will your numbers in (444)433-3949 form. I am doing this before I input
phone numbers into db as it then only has to run once per db entry, if you
do it as you pull the data it wastes energy imho.
Philip Olson
--
be outside the box.
On Sat, 14 Oct 2000, Todd Cary wrote:
> Jason -
>
> Yup!! That is exactly what I wanted. I use this when I am verifying a
> telephone number or a SSN. I then check the length. Also, I store the
> telephone numbers and the SSN's in the DB without the extra characters.
> Of course, I am open to suggestions..........
>
> Many thanks......
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> todd@aristesoftware.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>