src/MvcError.php
public function phone($val, $id) {
        $val = preg_replace('/[^0-9]/', '', $val);
        if (strlen($val) != 7 && strlen($val) != 10) {
            $this->add($id, 'Please enter a valid 7 or 10 digit phone number.');
            return false;
        }

        return true;
    }
public function phone($val, $id) {
        $val = preg_replace('/[^0-9]/', '', $val);
        if (strlen($val) != 7 && strlen($val) != 10) {
            $this->add($id, 'Please enter a valid 7 or 10 digit phone number.');
            return false;
        }

        return true;
    }
public function phone ( $ val , $ id ) { $ val = preg_replace ( '/[^0-9]/' , '' , $ val ) ; if ( strlen ( $ val ) != 7 && strlen ( $ val ) != 10 ) { $ this -> add ( $ id , 'Please enter a valid 7 or 10 digit phone number.' ) ; return false ; } return true ; }
Is a string a valid phone number?
Is a string a valid phone number?