代码是这样子的
pic.php
<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20) or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);
ImagePNG($im);
//ImagePNG($im,"11.png"); 
imagedestroy($im);
?>
html 文件
<html>
<body><img src=pic.php></img></body>
</html>gd库是没有问题的,因为在pic.php里面我都可以保持成png文件。
感谢各位大大了。