dershun / util
一些 php 常用工具类
1.4.1
2023-07-03 11:29 UTC
Requires
- php: >=7.0
This package is not auto-updated.
Last update: 2025-06-30 21:19:46 UTC
README
介绍
一些 php 常用工具类
软件架构
软件架构说明
安装
composer require dershun/util
类说明
- Tree 树结构生成类
use Dershun\Util\Tree
- NestableJs jQuery的Nestable 使用类
use Dershun\Util\NestableJs
- Layui Layui 框架使用类
use Dershun\Util\Layui
- SnowFlake 雪花算法类
use Dershun\Util\SnowFlake
SnowFlake::setConfig(1, 1);
$orderNum = SnowFlake::createId(); // 生成唯一ID
dump($orderNum);
- CaptchaPicture 图片验证码类
use Dershun\Util\CaptchaPicture
$Captcha = new CaptchaPicture([
'width' => 90,
'height' => 38,
"math" => true,
"curve" => false,
]);
// 返回字节流
$result = $Captcha->captcha()->base64();
$code = $Captcha->getCode();
$codeKey = $Captcha->getCodeKey();
// 直接输出到浏览器
$result = $Captcha->captcha();
$code = $Captcha->getCode();
$codeKey = $Captcha->getCodeKey();
$result->imagepng();