PHP code example of ella123 / hyperf-captcha
1. Go to this page and download the library: Download ella123/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/ */
ella123 / hyperf-captcha example snippets
php bin/hyperf.php vendor:publish ella123/hyperf-captcha
# 创建图片验证码
$data = \Ella123\HyperfCaptcha\captcha_create();
$key = $data['key']; # 验证码标识
$key = $data['img']; # 验证码图片
# 验证图片验证码
# $code: 用户输入的验证码
# $key: 创建验证码的时候返回的key
\Ella123\HyperfCaptcha\captcha_verify($code,$key);