public function validateParameterIsValid($userDate) { // $userData = array('telephone' => $_POST['tel'], 'password' => $_POST['password'], 'configPwd' => $_POST['confirmPwd'], 'phoneCode' => $_POST['phoneCode']); $phoneNumber = $userDate['telephone']; $pwd = $userDate['password']; $configPwd = $userDate['confirmPwd']; $util = new UtilsModel(); //判断手机号是否合法 if (!$util->validateMobileNumber($phoneNumber)) { $this->errorSendRedict("您输入手机号码不正确,正确格式 例如:15012344032", "register", $userDate); exit; } //判断密码长度是否正确 if (strlen($pwd) > 20 || strlen($pwd) < 6) { $this->errorSendRedict("您输入的密码长度不合法,合法长度应该是6-20位之间。", "register", $userDate); exit; } if ($pwd != $configPwd) { $this->errorSendRedict("您输入的密码和确认密码不一致,", "register", $userDate); exit; } }