PHP code example of cfn / math-captcha
1. Go to this page and download the library: Download cfn/math-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/ */
cfn / math-captcha example snippets
use MathCaptcha\Captcha;
$ca = new Captcha();
$code = $ca->setDigits(1)->setPoint(100)->setLine(2)->setFontSize(24)->result();
print_r("验证码结果:" . $code . "\n");
$image = $ca->base64();
print_r($image);