使用ob_clean();
public function verify(){
ob_clean();
$captcha = new Captcha();
//验证码过期时间(s)
$captcha->expire = 1800;
//是否画混淆曲线
$captcha->useCurve = true;
//是否添加杂点
$captcha->useNoise = true;
//验证码位数
$captcha->length = 4;
//验证成功后是否重置
$captcha->reset = true;
$captcha->imageH =50;
$captcha->fontSize =21;
return $captcha->entry();
}
如果是使用的 {:captcha_src()}
就去CaptchaController.php里面加ob_clean();
网友评论