Checking Phone Numbers
| From: | Kevin Murphy | Date: | Thu, 14 Jun 2007 15:38:06 +0000 |
| Subject: | Checking Phone Numbers | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-257002@lists.php.net to get a copy of this message | ||
I collect phone numbers via a web form that breaks the phone number up into 3 parts (3-digit area, 3-digit prefix, etc). Occasionally, I am having people put in a phone number such as 999-999-9999 or 000-000-0000 or other numbers that are all the same. How would I go about comparing those three fields to see if they are all the same numbers. I can't just exclude it anytime that the numbers all match, for example 444 is a valid area code. It should only fail if all the numbers are exactly the same.
All the processes I've come up with seem to be rather convoluted. Is there a simple way to test for this?
--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326