PHP code example of cocoa / captcha

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

    

cocoa / captcha example snippets


use Cocoa\Captcha\CaptchaBuilder;

$builder = new CaptchaBuilder;

$captcha = $builder->build();

$builder->output();

use Cocoa\Captcha\CaptchaBuilder;

$builder = new CaptchaBuilder;

$length = 5;

$captcha = $builder->build($length);

$builder->setWidth(120)->setHeight(36)->setContrast(0)->setInvert(false)->setSharpen(0)->setBgColor('#ffffff')->setBgImage(true)->setBlur(0)->setQuality(90)->setLines(3)->setAngle(10)->output();