修改过后的数字英文字符生成图片代码

header("Content-type: image/png");
$im = imagecreatetruecolor(280, 40);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$mycolor = imagecolorallocate($im, 32, 32,32);
imagefilledrectangle($im, 0, 0, 399, 50, $white);


$text = '13812520520';
$font = 'georgiab.ttf';
$filename= uniqid();
imagettftext($im,28, 0, 10, 30, $mycolor, $font, $text);
imagejpeg($im, 'file/mobile/'.$filename.'.jpg');
imagepng($im);
imagedestroy($im);

备份

原文地址:https://www.cnblogs.com/code123/p/3356899.html