PHP5中GD2函数库提供了强大的绘图功能。 安装完PHP后可以在浏览器的地址栏输入“http://127.0.0.1:端口号/phpinfo.php”, 按住回车键就可以检索到GD库的安装信息。 首先来演示一段代码 <?php header("Content-type:image/png"); $img=imagecreate(200, 200); $bg=imagecolorallocate($img, 12, 135, 20); $white=imagecolorallocate($img, 255, 255, 255); imagearc($img,100,100,150,150,0,360,$white); imagepng($img); imagedestroy($img); ?> 这是首先创建一个200X200的画布,并在画布上画了一个圆。