php输出图像乱码
<?phpheader("Content-Type:text/html;charset=utf-8");header("Content_Type:image/jpg");...
<?php
header("Content-Type:text/html;charset=utf-8");
header("Content_Type:image/jpg");
$image=imagecreate(300,80);
$bgcolor=imagecolorallocate($image,200,60,90);
$write=imagecolorallocate($image,0,0,0);
imagestring($image,5,80,30,"I Like PHP",$write);
imagejpeg($image);
imagedestroy($image);
?> 展开
header("Content-Type:text/html;charset=utf-8");
header("Content_Type:image/jpg");
$image=imagecreate(300,80);
$bgcolor=imagecolorallocate($image,200,60,90);
$write=imagecolorallocate($image,0,0,0);
imagestring($image,5,80,30,"I Like PHP",$write);
imagejpeg($image);
imagedestroy($image);
?> 展开
1个回答
展开全部
把第一个header()去掉,第二个header()里面写错了
<?php
header("Content-Type:image/jpg");
$image=imagecreate(300,80);
$bgcolor=imagecolorallocate($image,200,60,90);
$write=imagecolorallocate($image,0,0,0);
imagestring($image,5,80,30,"I Like PHP",$write);
imagejpeg($image);
imagedestroy($image);
?>
<?php
header("Content-Type:image/jpg");
$image=imagecreate(300,80);
$bgcolor=imagecolorallocate($image,200,60,90);
$write=imagecolorallocate($image,0,0,0);
imagestring($image,5,80,30,"I Like PHP",$write);
imagejpeg($image);
imagedestroy($image);
?>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询