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

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

WBOY
Release: 2016-06-13 11:24:32
Original
804 people have browsed it

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 />
Copy after login

PHP GD2 浏览器 编码
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template