header('Content-type:image/jpeg'); $witch = 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', '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'); $str_all = "";
  for ($i = 0; $i < 4; $i++) {     $str_all .= $element[rand(0, count($element) - 1)]; }
 
  $fontarray = array('Good-Hood/GoodHood-2.otf', 'Gap/Gap-Regular-3.ttf', 'Maria/Maria-Regular-2.otf'); $fontfile = "Study/D01/Captcha_module/font/" . $fontarray[rand(0, count($fontarray))];
 
  $img = imagecreatetruecolor($witch, $height);
  $color3 = imagecolorallocate($img, rand(100, 255), rand(200, 255), rand(200, 255));
  imagefill($img, 0, 0, $color3);
  $color5 = imagecolorallocate($img, rand(100, 189), rand(100, 200), rand(100, 190)); for ($i = 0; $i < 100; $i++) {          imagesetpixel($img, rand(1, $witch - 3), rand(1, $height - 3), $color5); } for ($i = 0; $i < 5; $i++) {          imageline($img, rand(0, $witch / 2), rand(0, $height / 2), rand($witc / 2, $witch), rand($height / 2, $height), $color5); }
 
  $color6 = imagecolorallocate($img, rand(10, 100), rand(10, 100), rand(10, 100));
 
  imagettftext($img, 15, rand(-5, 5), rand(5, 60), rand(15, 35), $color6, $fontfile, $str_all); imagejpeg($img); imagedestroy($img);
 
  |