<?php 
header("Content-Type:image/png");
function random($len)
{
	$str = '1234567890qwertyuioplkjhgfdsazxcvbnm';
	$strr = '';
	for($i=0;$i<$len;$i++)
	{
		$strr .= $str[rand(0,strlen($str))];	//随机字符
	}
	return $strr;
}
$im = imagecreate(100,100);
$bg = imagecolorallocate($im,255,255,255);	//背景白色
$pix = imagecolorallocate($im,26,147,234);		//干扰色
$font = imagecolorallocate($im,41, 163, 238);	//字体随机色
//干扰点
for($i=0;$i<200;$i++)
{
	imagesetpixel($im,rand(0,100),rand(0,100),$pix);
}
imagearc($im,10,30,55,55,55,125,$pix);		//干扰线
//生成图片
imagestring($im,5,30,40,random(4),$font);
//imagerectangle($im, 0, 0, 90, 90, $font);
//输出图片
imagepng($im);
//释放资源
imagedestroy($im);
?>
  
                    
                
 posted on 
                
            
        
浙公网安备 33010602011771号