Home >Backend Development >PHP Tutorial >php 输出图像乱码,求大家帮忙?

php 输出图像乱码,求大家帮忙?

WBOY
WBOYOriginal
2016-06-23 13:58:52910browse

header("content-type:image/png");
$a = imagecreate(100,100);
imagecolorallocate($a,255,0,255);
imagepng($a);
imagedestroy($a);
?>

环境是:xampp


回复讨论(解决方案)

乱码是什么情况,贴个截图出来看看。

图像乱码是什么意思?

没有问题。

<?php$im = imagecreate(100, 100);imagecolorallocate($im, 255, 0, 0);header('content-type:image/png');imagepng($im);imagedestroy($im);?>

谢谢大家,问题解决了,是文件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