php图片验证码输出问题

作者Veris 文章分类 分类:PHP 文章评论 0条评论 阅读次数 已被围观 2145

今天在把项目上传到服务器上的时候碰到了问题:图片验证码显示不出了,把header头注释掉看输出正常,文件头也是UTF8无BOM,网上百度了下,发现了ob_clean()这玩意儿,学习了。解释如下:

ob_clean这个函数的作用就是用来丢弃输出缓冲区中的内容,如果你的网站有许多生成的图片类文件,那么想要访问正确,就要经常清除缓冲区。

If you work on an extremely large project with a lot of source and required files, like myself, you will be well-advised to always clear the output buffer prior to creating an image in php. 

分类:PHP
标签: ob_clean()

发表评论: