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

验证图片出不来请

WBOY
WBOYOriginal
2016-06-13 13:46:19859browse

验证图片出不来请求助
/*$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编码格式 然后保存。 看提示什么错误。
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