PHP code example of tgkw-adc / hyperf-captcha
1. Go to this page and download the library: Download tgkw-adc/hyperf-captcha library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tgkw-adc / hyperf-captcha example snippets
php bin/hyperf.php vendor:publish tgkw-adc/hyperf-captcha
# 创建图片验证码
$data = \TgkwAdc\HyperfCaptcha\captcha_create();
$key = $data['key']; # 验证码标识
$key = $data['img']; # 验证码图片
# 验证图片验证码
# $code: 用户输入的验证码
# $key: 创建验证码的时候返回的key
\TgkwAdc\HyperfCaptcha\captcha_verify($code,$key);