public static function phone($check) { $pattern = '/^[0-9\\/. \\-]*$/'; return (bool) preg_match($pattern, $check); }
/** * test the phone method of DeValidation * * @return void */ public function testPhone() { $this->assertTrue(DeValidation::phone('0123456789')); $this->assertFalse(DeValidation::phone('sometext')); }