$color1,"G"=>$color2,"B"=>$color3); $fontcolor= imagecolorallocate($im,$color1,$color2,$color3); $last_x = $x * $i; imagestring($im, $fontsize , $last_x, $y , $str[$i-1], $fontcolor); } $_SESSION['check']= implode("",$str); $maxwidth=100; $maxheight=20; $pixel = rand(10,20); for($i=0;$i<=$pixel;$i++) { srand( microtime() * 10000000); $px =rand(0,$maxwidth); $py =rand(0,$maxheight); $color = imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255)); imagesetpixel ( $im, $px, $py, $color ); } for($i=0;$i<=10;$i++) { srand( microtime() * 10000000); $px =rand($x-3,$last_x+10); $py =rand($y,$maxheight); $array = $colors[rand(0,sizeof($colors)-1)]; $color = imagecolorallocate($im,$array["R"],$array["G"],$array["B"]); imagesetpixel ( $im, $px, $py, $color ); } imagepng($im); imagedestroy($im); ?>