PHP编写英文及数字验证码
php  /  管理员 发布于 9年前   895
注意(l ,o,1 ,0 一些感觉很难认的字符你删掉)
//画布
2.$im = imagecreatetruecolor(50, 25);
3.
4.//创建颜料
5.$gray = imagecolorallocate($im, 150, 150, 150);
6.
7.//随机码颜色
8.$randcolor = imagecolorallocate($im, mt_rand(0,250),mt_rand(0,250),mt_rand(0,250));
9.
10.//随机线颜色
11.$line = imagecolorallocate($im,mt_rand(0,150),mt_rand(0,150),mt_rand(0,150));
12.$line1 = imagecolorallocate($im,mt_rand(0,150),mt_rand(0,150),mt_rand(0,150));
13.$line2 = imagecolorallocate($im,mt_rand(0,150),mt_rand(0,150),mt_rand(0,150));
14.
15.//填充背景
16.imagefill($im, 0, 0, $gray);
17.//干扰线
18.imageline($im,0,mt_rand(0,25),50,mt_rand(0,25),$line);
19.imageline($im,0,mt_rand(0,25),50,mt_rand(0,25),$line1);
20.imageline($im,0,mt_rand(0,25),50,mt_rand(0,25),$line2);
21.//随机码
22.$str = substr(str_shuffle('qwetyuipasdfghjkzxcvbnm23456789'), 0,4);
23.
24.imagestring($im, 5, 5, 5, $str, $randcolor);
25.header('content-type: image/png');
26.imagepng($im);
27.
28.imagedestroy($im);test1 在
opencode + Oh-my-openagent,我的第一个免费的ai编程智能体管家:Sisyphus中评论 test..122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..Zita 在
Google AI Studio升级全栈 vibe coding体验,可直接构建带登录和数据库的应用中评论 111222..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号
