PHP code example of exinfinite / captcha
1. Go to this page and download the library: Download exinfinite/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/ */
exinfinite / captcha example snippets
composer
use Exinfinite\Captcha\Builder;
$captcha = new Builder();
//使用預設值產生
$captcha->build();
//自訂參數
$captcha->setSize(150, 45)
->setLine(6)
->setPixel(180)
->build();
$is_valid = $captcha->verify("使用者輸入內容");//Case-insensitive
$is_valid = $captcha->verify("使用者輸入內容", true);//Case-sensitive
if($is_valid === true){
...
}
$captcha->getTxt();