Home > Backend Development > PHP Tutorial > 验证图片出不来请

验证图片出不来请

WBOY
Release: 2016-06-13 10:10:16
Original
831 people have browsed it

验证图片出不来请求助
/*$image = imagecreatetruecolor(100,30);
imagecolorallocate();
imageString();*/
for($i = 0; $i $rand .= dechex(rand(1,15));
}
$image = imagecreatetruecolor(100,30); //创建一个图片

$bgallocate = imagecolorallocate($image,0,0,0); //图片背景颜色
$color = imagecolorallocate($image,255,255,255); //颜色

imagestring($image,5,0,0,$rand,$color);

header("Content-type: image/jpeg");
imagejpeg($image);
?>

为什么图片出不来
;extension=php_gd2.dll 前面的分号已经去掉了

------解决方案--------------------
代码无误!
请检查是否有 BOM 头
------解决方案--------------------

探讨
代码无误!
请检查是否有 BOM 头

------解决方案--------------------
用编辑器改为utf-8无BOM编码格式 然后保存。 看提示什么错误。
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