public static function phone($check) { $pattern = '/^([0-9]*\\-?\\ ?\\/?[0-9]*)$/'; return (bool) preg_match($pattern, $check); }
/** * test the phone method of ItValidation * * @return void */ public function testPhone() { $this->assertTrue(ItValidation::phone('347/1233456')); $this->assertFalse(ItValidation::phone('02+343536')); }