imagecreatetruecolor
imagecolorallocate
imagechar
imagestring
header
imagejpeg
imagedestroy
//创建画布
$width = 500;
$height = 300;
$image = imagecreatetruecolor($width, $height);
//创建颜色
$red = imagecolorallocate($image, 255, 0, 0);
$blue = imagecolorallocate($image, 0, 0, 255);
$white = imagecolorallocate($image, 255, 255, 255);
//开始绘画
imagechar($image, 40, 50, 100, 'K', $red);
imagechar($image, 40, 100, 200, 'i', $blue);
imagestring($image, 40, 200, 150, 'imooc', $white);
//显示图片
header('content-type:image/jpeg');
imagejpeg($image);//imagegif() imagepng()
//销毁资源
imagedestroy($image);