personId() public static method

Compliant with GB11643-1999 national standard.
public static personId ( string $check ) : boolean
$check string The value to check.
return boolean Success.
Example #1
0
 /**
  * test the personId method of CnValidation
  *
  * @return void
  */
 public function testPersonId()
 {
     $this->assertTrue(CnValidation::personId('361181198507131951'));
     $this->assertTrue(CnValidation::personId('361181197902271319'));
     $this->assertTrue(CnValidation::personId('36118119780214411X'));
     $this->assertTrue(CnValidation::personId('632321198701161557'));
     $this->assertFalse(CnValidation::personId('123'));
     $this->assertFalse(CnValidation::personId('1632321198701161557'));
     $this->assertFalse(CnValidation::personId('X12312412412431233'));
     $this->assertFalse(CnValidation::personId('361181198507131952'));
     $this->assertFalse(CnValidation::personId('36118119790227131X'));
     $this->assertFalse(CnValidation::personId('361181197802144119'));
 }