guojikai/captcha-image-creator

一个PHP写的中文验证码图片生成工具,仅生成验证码图片不进行缓存,需封装使用。

v1.0 2016-01-20 05:21 UTC

This package is not auto-updated.

Last update: 2024-05-25 16:39:39 UTC


README

一个PHP写的中文验证码图片生成工具,仅生成验证码图片不进行缓存,需封装使用。

安装

使用 Composer 安装:

composer require guojikai/captcha-image-creator

在入口文件引入 Composer 启动脚本: (eg. index.php)

require 'vendor/autoload.php';

使用

<?php

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();
}

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

?>