Reply to US phone number validation

Your name:

Reply:


Posted by JackM on 11/18/84 11:44

I'm still working on validating the phone numbers that are entered on a
form but have come across a problem I don't understand how to fix. I can
handle most instances when it's in regular US formats (555-555-5555 or
(555) 555-5555 or 555 555 5555) but I'm having trouble when the entry is
ten consecutive numbers with nothing else (5555555555). Not only does it
not validate, but it shows as 2147483647 when I call the variable to
check to see how it is set. I know I could break the form up into three
values as in <input name="phone[area]"> <input name="phone[code]"> and
<input name="phone[num]"> to eliminate that happening but I don't like
the look of that and I know there's a better way that I haven't found.

I tried googling for information on a preg_replace statement that could
do what I need (check the phone number and add a space between the 3rd
and 4th and the 6th and 7th digits if there isn't one there already) but
I haven't been successful.

What do I need to do to handle this?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация