if (empty($_POST['tel'])) { $this->error("手机不能为空!"); } if(strlen($_POST['tel']) != 11){ $this->error("手机号必须是11位!"); } if(!is_numeric($_POST['tel'])){ $this->error("手机号必须是数字!"); }