<?php
header('Content-type:image/jpeg');
$width=120;
$height=40;
$element=array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9');
$string='';
for ($i=0;$i<4;$i++){
$string.=$element[rand(0, count($element)-1)];
}
$img=imagecreatetruecolor($width, $height);
$color=imagecolorallocate($img, rand(200,255), rand(200,255), rand(200,255));
$fontcolor=imagecolorallocate($img, rand(0,100), rand(0,100), rand(0,100));
imagefill($img, 0, 0, $color);
for ($i=0;$i<=500;$i++){
imagesetpixel($img, rand(0,$width-1), rand(0,$height-1), imagecolorallocate($img, rand(0,255), rand(0,255), rand(0,255)));
}
imagettftext($img, 25, rand(-5, 5), rand(8, 22), rand(20, 35), $fontcolor, 'font/Parisine-BoldItalic.woff.ttf', $string);
imagejpeg($img);
imagedestroy($img);
?>
转载请注明原文地址:https://ipadbbs.8miu.com/read-53338.html