php操作图片问题,可追加分

<?php
$width=200;
$height=200;
$img=imagecreatetruecolor($width,$height);
imagepng($img);
imagedestroy($img);

?>

每次运行时都显示图片下载,怎么办

输出了一个图片,会下载的,设置一下header,或者用另外一个文件插入这个图片<img src="xxx.php" ... />
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-08-05
header("Content-type: image/png");加上这句就OK 了
相似回答