zyan / captcha
计算型图形验证码
Installs: 14 523
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.3
- intervention/image: ^2.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.18
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-03-01 00:34:46 UTC
README
加减乘除计算图形验证码
要求
- php >= 7.3
- Composer
安装
composer require zyan/captcha -vvv
用法
use Zyan\Captcha\Captcha; $config = [ 'width' => 108, //宽度 'height' => 38, //高度 'background' => '#eee', //底色 'font_size' => 20, //字体大小 'session' => true //使用sessoin保存及验证 ]; $captcha = Captcha::make($config); //$cofnig 为可选,默认为上参数
保存验证码图片
$captcha->save($filename);
获取计算值(用于自己验证)
$captcha->getCode();
通过session验证是否通过
$captcha->verify($code); //如通过验证,会清除session
参与贡献
- fork 当前库到你的名下
- 在你的本地修改完成审阅过后提交到你的仓库
- 提交 PR 并描述你的修改,等待合并