$this->check=new Class_Check(array(
'require' =>array(".+",'必须的'),
'email' =>array("(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)?",'邮箱'),
'percent' =>array("([-\+]?\d+(\.\d+)?%+)?","百分比"),
'number' =>array("\d*","数字"),
'URL' =>array("([\w]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*)?","URL地址"),
'httpURL' =>array("(http:\/\/[\w]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*)?","完整的URL"),
'integer' =>array("([-\+]?\d+)?","整数"),
'float' =>array("([-\+]?\d+(\.\d+)?)?","浮点"),
'english' =>array("[A-Za-z]*","英文"),
'phone' =>array("[\d-]*","电话号码"),
'postcode' =>array("[1-9]?\d{0,5}","邮编"),
));
$this->fields=array(
'name'=>'姓名',
'age'=>'年龄'
);
阅读(484) | 评论(0) | 转发(0) |