在使用php创建图片时,无法正常生成图片
header("Content-type: image/png");
$img=imagecreatetruecolor(200,200);
imagepng($img);
imagedestroy($img);
出现的居然是这样的图片:
清除缓存后就能正常显示了,加入
ob_clean();
代码如下:
ob_clean();
header("Content-type: image/png");
$img=imagecreatetruecolor(200,200);
imagepng($img);
imagedestroy($img);
?>
以上就介绍了php绘制图片失败,使用清除缓存ob_clean可以解决。,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
已抢186198个
抢已抢67147个
抢已抢352746个
抢已抢666784个
抢已抢121587个
抢已抢22560个
抢