PHP code example of minxinqing / captcha

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

    

minxinqing / captcha example snippets


/**
 * @Inject
 * @var ContainerInterface
 */
protected $container;

// 生产验证码
$captcha = new Captcha($this->container->get(ConfigInterface::class), $this->container->get(SessionInterface::class));
return $captcha->create();

// 验证
$captcha->check($code);