您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 南充分类信息网,免费分类信息发布

php生成数字字母的验证码图片_PHP

2024/3/7 17:25:30发布21次查看
php生成数字字母的验证码图片
<?phpheader ('content-type: image/png');$image=imagecreatetruecolor(100, 30);$color=imagecolorallocate($image, 255, 255, 255);imagefill($image, 20, 20, $color);//只含有数字// for($i=0;$i<4;$i++){ // $font=6; // $x=rand(5,10)+$i*100/4; // $y=rand(8, 15); // $string=rand(0, 9); // $color=imagecolorallocate($image, rand(0,120), rand(0,120), rand(0,120)); // imagestring($image, $font, $x, $y, $string, $color);// }//含有数字和字母的for($i=0;$i<4;$i++){ $fontsize=6; $x=rand(5,10)+$i*100/4; $y=rand(5, 15); $data='abcdefghijklmnopqrstuvwxyz123456789'; $string=substr($data,rand(0, strlen($data)),1); $color=imagecolorallocate($image,rand(0,120), rand(0,120), rand(0,120)); imagestring($image, $fontsize, $x, $y, $string, $color);}//干扰点元素for($i=0;$i<200;$i++){ $pointcolor=imagecolorallocate($image, rand(100, 255), rand(100, 255), rand(100, 255)); imagesetpixel($image, rand(0, 100), rand(0, 30), $pointcolor);}//干扰线元素for($i=0;$i
以上所述就是本文的全部内容了,希望大家能够喜欢。
南充分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录