postal() public static method

Checks a postal code for The Netherlands
public static postal ( string $check ) : boolean
$check string The value to check.
return boolean Success.
Example #1
0
 /**
  * test the postal method of NlValidation
  *
  * @return void
  */
 public function testPostal()
 {
     $this->assertTrue(NlValidation::postal('1620AB'));
     $this->assertTrue(NlValidation::postal('1620 AB'));
     $this->assertTrue(NlValidation::postal('5020FZ'));
     $this->assertTrue(NlValidation::postal('5020 FZ'));
     $this->assertFalse(NlValidation::postal('5020-FZ'));
     $this->assertFalse(NlValidation::postal('5020'));
     $this->assertFalse(NlValidation::postal('0110 AS'));
     $this->assertFalse(NlValidation::postal('50222FZ'));
 }