Re: Validation class method (ssn)
| From: | Tim Gallagher | Date: | Thu, 06 Jun 2002 20:50:34 +0000 |
| Subject: | Re: Validation class method (ssn) | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6760@lists.php.net to get a copy of this message | ||
At 02:48 PM 6/6/2002 -0500, Brent Cook wrote:
Here is a script to convert the list of high SSN numbers from the SSA website into a PHP array. Well, it actually generates the code for a PHP array, which could be loaded by a validation function very quickly. I'm working on the validator now. ...Here is a function to determine the ssnGroup number from a given group function ssnGroup($groupNumber) {
if ($groupNumber < 10) {
if ($groupNumber%2 == 0) {
return 3;
} else {
return 1;
}; // end if
} elseif ($groupNumber > 9) {
if ($groupNumber%2 == 0) {
return 2;
} else {
return 4;
}; // end if
}; // end elseif
}; // end func
echo "Group " . ssnGroup("1") . "<BR>";
echo "Group " . ssnGroup("20") . "<BR>";
echo "Group " . ssnGroup("04") . "<BR>";
echo "Group " . ssnGroup("83") . "<BR>";Z
the example should print:
Group 1
Group 2
Group 3
Group 4
-timmyg