if(!eregi("^1[0-9]{10}$",$tel)){showMsg('手机号码不对,请正确填写', '-1');exit();} |
if (!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email)) {showMsg('请您填写正确的E-Mail 地址!', '-1');exit();} |
if($required!=''){if(preg_match('/,/', $required)){$requireds = explode(',',$required);foreach($requireds as $field){if($$field==''){showMsg('带*号的为必填内容,请正确填写', '-1');exit();}}}else{if($required==''){showMsg('带*号的为必填内容,请正确填写', '-1');exit();}}}//end |
新闻热点
疑难解答