<?php
$width = 200;
$height = 50;
$image = imagecreatetruecolor($width,$height);
$white = imagecolorallocate($image,255,255,255);
$rand_color = imagecolorallocate($image,mt_rand(60,125),mt_rand(60,125),mt_rand(60,125));
imagefilledrectangle($image,0,0,$width,$height,$white);
$string = join('',array_merge(range(0,9),range('a','z'),range('A','Z')));
$number = 4;
for($i = 0;$i < $number;$i++){
$angle = mt_rand(-15,15);
$fontsize = mt_rand(24,28);
$text = str_shuffle($string)[0];
$x = 20 + 40 * $i;
$y = 35;
imagettftext($image,$fontsize,$angle,$x,$y,$rand_color,'msyh.ttc',$text);
}
header('content-type:image/png');
imagepng($image);
imagedestroy($image);
?>