PHP利用GD库随机生成图片
<?php
$img=imagecreate(600,400);
$dark=imagecolorallocate($img,0,0,0);
$white=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$dark);//填充背景色
$font="./font/msyh.ttf";
$str=$_GET['title'];
imagettftext($img,12,0,50,50,$white,$font,$str);
header("Content-type:image/png");
imagepng($img);
imagedestroy($img);
?>


