public static function personId($check)
{
$pattern = '/\\A\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b\\z/i';
return (bool) preg_match($pattern, $check);
}
/** * test the ssn method of UsValidation * * @return void */ public function testSsn() { $this->assertFalse(UsValidation::personId('11-33-4333')); $this->assertFalse(UsValidation::personId('113-3-4333')); $this->assertFalse(UsValidation::personId('111-33-333')); $this->assertTrue(UsValidation::personId('111-33-4333')); }