1. Go to this page and download the library: Download dkh/captcha-generator 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/ */
dkh / captcha-generator example snippets
// Default size: 3 and default difficulty level: 1
$expression_captcha = new ExpressionCaptcha();
$string_captcha = new StringCaptcha();
// Specific size and difficulty level
$size = 10;
$level = 2;
$another_expression_captcha = new ExpressionCaptcha($size, $level);
$_SESSION['captcha'] = $captcha->solve();
// Or in a way that is infrequent,
// use static method *Captcha::solveString()
$my_expression = '1+6:3-2*4';
$_SESSION['my_captcha'] = ExpressionCaptcha::solveString($my_expression);