02-02-2021, 12:28 AM
I have created a Captcha library that can probably be used in the same way as CodeIgniter3.
https://github.com/kenjis/ci3-like-captcha
Code:
$ composer require kenjis/ci3-like-captcha
PHP Code:
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'],
];
https://github.com/kenjis/ci3-like-captcha