Home  >  Article  >  Backend Development  >  PHP输出图像到浏览器的有关问题

PHP输出图像到浏览器的有关问题

WBOY
WBOYOriginal
2016-06-13 12:05:241000browse

PHP输出图像到浏览器的问题
新手才学PHP绘制图像然后输出到浏览器,为什么用IE的时候提示的是下载图片,用chrome的时候是正常显示的,下面是代码

<br />$image = imagecreatetruecolor(300, 300);<br />$white = imagecolorallocate($image, 0,0,64);<br />imagefill($image,0,0,$white);<br />header("Content-type:image/png");<br />imagepng($image);<br />

------解决方案--------------------
代码没有问题,你用IE几测试的。
------解决方案--------------------
代码是正常的。是不是你安装了插件,访问图片会直接下载?

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