PHP code example of kenjis / ci3-like-captcha

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

    

kenjis / ci3-like-captcha example snippets


use Kenjis\CI3Like\Captcha\Captcha;

$vals = [
    'word'      => random_string('numeric', 4),
    'img_path'  => FCPATH . 'captcha/',
    'img_url'   => base_url() . '/captcha/',
];
$cap = Captcha::createCaptcha($vals);

$data = [
    'captcha_id'   => '',
    'captcha_time' => $cap['time'],
    'word'         => $cap['word'],
];