phone() public static method

Checks a phone number for The Netherlands
public static phone ( string $check ) : boolean
$check string The value to check.
return boolean Success.
Beispiel #1
0
 /**
  * test the phone method of NlValidation
  *
  * @return void
  */
 public function testPhone()
 {
     $this->assertTrue(NlValidation::phone('020-5045100'));
     $this->assertTrue(NlValidation::phone('0572-212121'));
     $this->assertTrue(NlValidation::phone('0205045100'));
     $this->assertTrue(NlValidation::phone('0572212121'));
     $this->assertTrue(NlValidation::phone('0653123456'));
     $this->assertTrue(NlValidation::phone('06-53123456'));
     $this->assertFalse(NlValidation::phone('020-50451009'));
 }