使用ob_clean();
public function verify(){
ob_clean();
$captcha = new Captcha();
//驗(yàn)證碼過(guò)期時(shí)間(s)
$captcha->expire = 1800;
//是否畫(huà)混淆曲線
$captcha->useCurve = true;
//是否添加雜點(diǎn)
$captcha->useNoise = true;
//驗(yàn)證碼位數(shù)
$captcha->length = 4;
//驗(yàn)證成功后是否重置
$captcha->reset = true;
$captcha->imageH =50;
$captcha->fontSize =21;
return $captcha->entry();
}
如果是使用的 {:captcha_src()}
就去CaptchaController.php里面加ob_clean();
