SSN Validation Class
| From: | Brent Cook | Date: | Sat, 08 Jun 2002 00:10:45 +0000 |
| Subject: | SSN Validation Class | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6792@lists.php.net to get a copy of this message | ||
Okee dokey,
This is the validation class for SSNs. This is how it might be used:
include 'Validate/US.php';
$test_numbers = array ('123-23-2313','463911234','123-45-6789',
'000-11-1111','111-00-1231','123-03-3434',
'999-12-3452', '743-99-2311');
$ssn_high_groups = ValidateUS::ssnGetHighGroups();
foreach ($test_numbers as $number) {
echo $number.' is ';
if (ValidateUS::ssn($number, $ssn_high_groups))
echo "Valid\n";
else
echo "Invalid\n";
}
It is intended to be placed where Tomas indicated, in Validation. Enjoy.
You can use it without passing the list of high ssn group numbers, but it
then pulls that data every time from the SSA webpage.
- Brent