1. Go to this page and download the library: Download sandpear/validate-code 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/ */
sandpear / validate-code example snippets
use Sandpear\ValidateCode\GraphValidateCode;
$ValidateCode = new GraphValidateCode();
$code = $ValidateCode->createGraphValidateCode('1234')->getCode();
fwrite_log('固定验证码:' . $code);
$ValidateCode->outputPng(true);
use Sandpear\ValidateCode\GraphValidateCode;
$ValidateCode = new GraphValidateCode();
$code = $ValidateCode->createGraphValidateCode()->getCode();
fwrite_log('随机验证码:' . $code);
$ValidateCode->outputPng(true);