PHP code example of wiejakp / captcha

1. Go to this page and download the library: Download wiejakp/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/ */

    

wiejakp / captcha example snippets


use wiejakp\captcha\CaptchaService;

$captcha = new CaptchaService();
$challenge = $captcha->createPositiveCaptchaChallenge();

echo $challenge->getChallenge();

if ($challenge->isEqual($submittedAnswer)) {
    // The answer is valid.
}