用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2290|回复: 0
收起左侧

[HELP] 关于Form_validation表单验证的问题

[复制链接]
发表于 2012-3-14 17:03:26 | 显示全部楼层 |阅读模式
$this->form_validation->set_rules('aa', '', 'valid_email|regex_match[/^\d{6,15}$/]');
我想将规则变为'或'的逻辑形式 怎么写啊

function _check($str){
                //valid_email|regex_match[/^\d{6,15}$/]
                if ($this->form_validation->valid_email($str)||$this->form_validation->regex_match($str,'/^\d{6,15}$/')){
                        return TRUE;
                }else{
                        $this->form_validation->set_message('check', 'The %s woring');
                        return FALSE;
                }
        }
我写了个自定义验证
求规范写法

本版积分规则