$img = imagecreatetruecolor(140, 50); $black = imagecolorallocate($img, 8, 8, 8); $color[] = imagecolorallocate($img, 255, 48, 0); $color[] = imagecolorallocate($img, 255, 114, 0); $color[] = imagecolorallocate($img, 254, 105, 66); $color[] = imagecolorallocate($img, 255, 168, 0); $color[] = imagecolorallocate($img, 255, 255, 255); shuffle($color); imagefilledrectangle($img, 0, 0, 140, 50, $black); imagecolortransparent($img, $black); $string = 'asdfgqweryxcvtzuvbnmghjkp123456789'; $pocet = strlen($string); $x = 20; $cely = ''; for($prubeh = 0; $prubeh < 5; $prubeh++) { $cely .= $znak = strtoupper($string[rand(0, $pocet-1)]); imagettftext($img, 20, rand(-30, 30), $x += 17, 30, $color[$prubeh], './tahoma.ttf', $znak); } header("Content-type: image/png"); imagepng($img); imagedestroy($img);