时间:2021-07-01 10:21:17 帮助过:27人阅读
ob_clean();
header("Content-type:image/png");
$im = @imagecreate(200, 100);
@imagecolorallocate($im, 240, 150, 255);
$color1 = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 8, 10, "I like PHP", $color1);
imagedestroy($im);
?>
ob_clean();
header("Content-type:image/png");
$im = @imagecreate(200, 100);
@imagecolorallocate($im, 240, 150, 255);
$color1 = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 8, 10, "I like PHP", $color1);
imagepng ( $im);//少了生成图片这个语句
imagedestroy($im);