Home  >  Article  >  Backend Development  >  GD2绘制图形在浏览器中不能展示

GD2绘制图形在浏览器中不能展示

WBOY
WBOYOriginal
2016-06-13 12:47:12924browse

GD2绘制图形在浏览器中不能显示
绘制了一个图形,如果是以ANSI格式编码可以在浏览器输出
但是以UTF-8格式编码就不能显示图形,这是什么原因?求指教!!!

代码如下:

<br />
<?php<br />
$im = imagecreatetruecolor(50,25);<br />
<br />
$red = imagecolorallocate($im,255,0,0);<br />
$str = 'ABCDEFGHIJKMNPQRSTUVWXTZabcdefghijkmnpqrstuvwxtz23456789';<br />
$str = substr(str_shuffle($str),0,4);<br />
imagestring($im,5,8,5,$str,$red);<br />
<br />
header('content-type:image/png');<br />
imagepng($im);<br />
imagedestroy($im);<br />
<br />
<br />
?><br />

PHP GD2 浏览器 编码
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn