PHP code example of arcaptcha / arcaptcha-php

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

    

arcaptcha / arcaptcha-php example snippets


use Mohammadv184\ArCaptcha\ArCaptcha;

$ArCaptcha = new ArCaptcha($siteKey, $secretKey);

// To set options like color,lang,...
$ArCaptcha = new ArCaptcha($siteKey, $secretKey,['lang'=>'en','theme'=>'dark']);


 echo $ArCaptcha->getScript() 

if ($ArCaptcha->verify($_POST["arcaptcha-response"])) {
    echo "OK!";
} else {
    echo "FAILED!";
}
bash
composer