PHP code example of guojikai / captcha-image-creator

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

    

guojikai / captcha-image-creator example snippets






use Pcic\Pcic;
use Pcic\PcicException;

try {
	//Print captcha image with params: String, Width, Height (eg. 宫保鸡丁, 180, 60)
	Pcic::createCaptchaImage('宫保鸡丁'); 
} catch (PcicException $e) {
	echo $e->getMessage();
}

//将直接显示验证码图片