visavi/captcha
最新稳定版本:v3.0.0
Composer 安装命令:
composer require visavi/captcha
包简介
Animated captcha generator
关键字:
README 文档
README
Examples
Default
Advanced
Mini
Methods
- getPhrase - Get phrase
- setWidth - Image width, px (Optional, default 150px)
- setHeight - Image height, px (Optional, default 40px)
- setTextColor - Text color (Optional)
- setBackgroundColor - Background color (Optional)
- setFont - Font path (Optional)
- setWindowWidth - Window width, px (Optional, default 75px)
- setPixelPerFrame - Window shift per frame, px (Optional, default 15px)
- setDelayBetweenFrames - Time between frames, ms) (Optional, default 20ms)
Code default
header('Content-Type: image/gif'); $captcha = new CaptchaBuilder(); $_SESSION['captcha'] = $captcha->getPhrase(); return $captcha->render();
Code advanced
header('Content-Type: image/gif'); $phrase = new PhraseBuilder(); $phrase = $phrase->getPhrase(5, '1234567890'); $captcha = new CaptchaBuilder($phrase); $captcha ->setWidth(150) ->setHeight(50) ->setTextColor(0, 0, 0) ->setBackgroundColor(255, 255, 255) ->setFont('/path-to-font') ->setWindowWidth(60) ->setPixelPerFrame(15) ->setDelayBetweenFrames(20); $_SESSION['captcha'] = $captcha->getPhrase(); return $captcha->render();
Installation
composer require visavi/captcha
License
The class is open-sourced software licensed under the MIT license
统计信息
- 总下载量: 1.84k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-15








