PHP头条
热点:

PHP图像输出乱码,该如何解决


PHP图像输出乱码
刚开始学PHP,这个代码为何输出乱码
   $im = imagecreate(200,60);
   $white = imagecolorallocate($im, 225, 66, 159);
   imagegif($im);
?>


------解决方案--------------------
贴个截图看看
------解决方案--------------------
$im = imagecreate(200,60);
$white = imagecolorallocate($im, 225, 66, 159);
   // 输出图像到浏览器
header ( 'Content-Type: image/gif' );
imagegif($im);

------解决方案--------------------
去掉第一个 ------解决方案--------------------
引用:
Quote: 引用:

你就单独运行我给你的代码是肯定可以的

可以了,3Q啊。那个header是啥啊,书上还没介绍过


header() 函数向客户端发送原始的 HTTP 报头。
认识到一点很重要,即必须在任何实际的输出到浏览器被发送之前调用 header() 函数
你可以百度下里面有很多设置的

www.phpzy.comtrue/phprm/4417.htmlTechArticlePHP图像输出乱码,该如何解决 PHP图像输出乱码 刚开始学PHP,这个代码为何输出乱码 $im=imagecreate(200,60); $white=imagecolorallocate($im,225,66,159); imagegif($im); ?> ------解决方案-------------------- 贴个截...

相关文章

相关频道:

PHP之友评论

今天推荐