1、必須由英文,數字組合而成的字符串:
if(!preg_match("/^(([a-z]+[0-9]+)|([0-9]+[a-z]+))[a-z0-9]*$/i",$spend)){
return $this->_ajaxMessage(1, '模板id必須由字母和數字組成', array());
}
2、由數字,英文字符與下劃線:
if(!preg_match("/^[a-zA-Z0-9_]*$/i",$spendCancel)){
return $this->_ajaxMessage(1, '您輸入的消費撤銷通知模板id不合法', array());
}