Home  >  Article  >  Backend Development  >  php页面返回图片有关问题

php页面返回图片有关问题

WBOY
WBOYOriginal
2016-06-13 13:43:581110browse

php页面返回图片问题
整个页面的代码就是下面这些
header("Content-type:image/jpeg");
$img=imagecreatefromjpeg("1.jpg");
imagejpeg($img);
imagedestroy($img);
?>
保存为photo.php,而且同目录下有文件 1.jpg
在浏览器中打开后只有图片占位符?为什么-在线等
用的wamp,php为5.3.8

------解决方案--------------------
代码没有问题。如果是utf-8编码。要保证没有BOM头。

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