blok/utils

一系列PHP实用函数

1.2.1 2022-06-20 15:19 UTC

This package is auto-updated.

Last update: 2024-09-20 20:05:54 UTC


README

Packagist Packagist Packagist

PHP项目的实用脚本

安装

通过composer安装

composer require blok/utils

使用方法

Arr

Blok\Utils\Arr提供了一系列数组相关的方法工具,你可以作为静态调用使用,例如

Blok\Utils\Arr::csvToArray('xxx.csv')

将csv文件转换为数组

Str

Blok\Utils\Str提供了一系列字符串相关的方法工具,你可以作为静态调用使用,例如

Str::smrtr('{hello} world', ["hello", "Hello"])

将花括号{hello}替换为数组的值

Utils

Blok\Utils\Utils提供了一系列常见的PHP工具方法,你可以作为静态调用使用,例如

Utils::getJSON("xxx.json")

执行file_get_contents + json_decode

Utils::removeSubfolder($your_dir, ".git")

删除所有.git文件夹

安全性

如果你发现任何安全相关的问题,请通过电子邮件联系,而不是使用问题跟踪器。

致谢