PHP code example of luphp / think-captcha
1. Go to this page and download the library: Download luphp/think-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/ */
luphp / think-captcha example snippets
CaptchaApi::checkSMS($code,$key);
CaptchaApi::checkSMS($code,$key,true); //强制删除缓存,用于验证次数限制
其中code为用户输入的短信验证码, key为上面返回到key 用于替代session, 同时使用cache作为缓冲。
CaptchaApi::check($code,$key);
其中code为用户输入的验证码, key为上面返回到key 用于替代session, 同时使用cache作为缓冲