normeno / base64-handler
Base64处理器
v1.0
2018-07-30 16:06 UTC
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is not auto-updated.
Last update: 2024-09-22 04:17:52 UTC
README
一个简单且强大的用于处理Base64的包。
目前仅在图像(png, jpg, svg, doc, docx, pdf)上进行了测试
需求
- PHP >= 7.1
用法
初始化库
$base64Handler = new Base64Handler();
文件转Base64
路径
$file = 'path/to/file.png'; $convert = $base64Handler->toBase64($file);
URL
$file = 'http://icons.iconarchive.com/icons/graphicloads/100-flat/256/home-icon.png'; $convert = $base64Handler->toBase64($file);
Base64转文件
$base64 = 'xyz'; $convert = $base64Handler->toFile($base64);
检查Base64类型
$base64 = 'xyz'; $getFile = $base64Handler->getBase64Type($base64);
待办事项
- 检查Base64是否为PDF
许可证
Base64处理器 是开源软件,采用MIT许可证。
捐赠
如果你觉得这个项目很有用,你可以为作者买一杯果汁