guojikai / captcha-image-creator
这是一个用PHP编写的中文验证码图片生成工具,仅生成验证码图片不进行缓存,需要封装使用。
v1.0
2016-01-20 05:21 UTC
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2024-09-14 18:04:21 UTC
README
这是一个用PHP编写的中文验证码图片生成工具,仅生成验证码图片不进行缓存,需要封装使用。
安装
使用 Composer 安装:
composer require guojikai/captcha-image-creator
在入口文件引入 Composer 启动脚本: (例如 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(); } //将直接显示验证码图片 ?>