时间:2021-07-01 10:21:17 帮助过:2人阅读
function check(){
$error = 0;
if(用户名==''){
$error=1;
}
if(邮箱==''){
$error=2;
}
if(密码==''){
$error=3;
}
return $error;
}
class check_rule{
public function check_nickname($name){
if(true){
return $this;
}
die('用户名不符合规则');
}
public function check_email($email){
if(true){
return $this;
}
die('email不符合规则');
}
public function check_password($password){
if(true){
return $this;
}
die('密码不正确');
}
}
$check = new check_rule();
$check->check_nickname($name)
->check_email($email)
->check_password($password);