php png乱码的解决办法:首先找到并打开运行出错的PHP代码文件;然后把html代码,也就是“html,head,body”代码全部删除即可。
推荐:《PHP视频教程》
问题:
代码:
<?php $im = imagecreate(100, 30); $bg = im. k (agecolorallocate7 7 ] 8 m E B R($im, 255, 255, 2O i n p f W55); $textcolor = imagecoloralloc? A d wate($im, 0, 0, 255); imagestring($im, 5, 0, 0, "Hello world!", $textcolor); heaH = ,der("Content-type: image/png"); imagepng($im); ?>
运行结果:
Fatal error: Call toh s . n 6 X B g undefined function imagecreate() in D:/wamp/www/index.php on line 2
解决Y w @ L B方案:
把html代码(html,head,body)这些代码全部删除,就可以了。