我刚学PHP不久,在使用GD2库创建图像时在浏览器中显示不出来图像,只有一个代表图像的标志,我的代码如下:
<?php
header("content-type:image/gif");
$image = imagecreate(300,80);
$bg = imagecolorallocate($image, 220, 40, 120);
imagegif($image);
?>
应该没问题,但是就是显示不了,各位大侠求指导啊!谢谢!
<?php
header("content-type:image/gif");
$image = imagecreate(300,80);
$bg = imagecolorallocate($image, 220, 40, 120);
imagegif($image);
?>
应该没问题,但是就是显示不了,各位大侠求指导啊!谢谢!
请去掉 BOM 头
display_errors=On
error_reporting=E_ALL & ~NOTICE
重启apache
那么新建一个程序,内容为:
<?php
coho base64_encode(file_get_contents('http://localhost/pict.php'));运行后贴出结果