PHPackages                             chenqionghe/utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chenqionghe/utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chenqionghe/utils
=================

utils

v0.0.1(8y ago)0291MITPHP

Since May 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/chenqionghe/utils)[ Packagist](https://packagist.org/packages/chenqionghe/utils)[ RSS](/packages/chenqionghe-utils/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (1)

util工具类集合
=========

[](#util工具类集合)

提供数组、字符串、地址解析等功能

namespace
---------

[](#namespace)

```
"chenqionghe\\Utils\\": "src/"

```

工具类
---

[](#工具类)

类功能Arrays提供数组常用操作Strings提供字符串常用操作URLUtilURL地址处理工具类Arrays
------

[](#arrays)

- get($array, $key, $default = null) - 根据给定的key获取数组中的值，如果key的值不存在，将返回default定义的默认值
- sGet($array, $key, $default = null) - 根据给定的key获取数组中的值，如果key的值为空，将返回default定义的默认值
- lists($array, $key) - 根据key重建数组索引
- merge($a, $b) - 递归合并两个或多个数组
- keyToCamel($array) - 递归将数组的键转为驼峰
- keyToCase($array) - 递归将数组的键转为小写下划线
- removeKeys($array, $removeKeys) - 递归移除数组指定的key

Strings
-------

[](#strings)

- case2camel($string) - 小写下划线字符串转换为驼峰
- camel2case($string) 驼峰字符串转为小写下划线
- random($length = 16) 创建随机数
- uuid() - 生成维一id
- parseMultiValue($value, $func = '') - 折分字符串为多个值,支持中文逗号/英文逗号/空格
- isAssoc() - 判断是否是关联数组
- isMultidim() - 判断是否是多给数组

URLUtil
-------

[](#urlutil)

- toHttps() - 将url地址http改为https
- addParameter($url, $params) - 给URL地址追加get参数
- getParameters($url) - 根据URL地址获取query string

单元测试
----

[](#单元测试)

- 1.安装单元测试依赖代码

```
composer require phpunit/phpunit

```

- 2.执行单元测试(代码位于tests文件夹)

```
phpunit

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2930d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/635a07cece1b5cffe9f3e3390902d1879547859385ee15648c9d1a9b0bf05180?d=identicon)[chenqionghe](/maintainers/chenqionghe)

---

Tags

base

### Embed Badge

![Health badge](/badges/chenqionghe-utils/health.svg)

```
[![Health](https://phpackages.com/badges/chenqionghe-utils/health.svg)](https://phpackages.com/packages/chenqionghe-utils)
```

###  Alternatives

[aza/math

AzaMath - Anizoptera CMF mathematic component. Arbitrary precision arithmetic (for huge integers; BCMath wrapper) and universal convertor between positional numeral systems (supported bases from 2 to 62 inclusive, and systems with custom alphabet; pure PHP realisation, can use GMP and core PHP functions for speed optimization).

1921.9k1](/packages/aza-math)[mnastalski/baselinker-php

Base.com (formerly BaseLinker) PHP library

1530.4k](/packages/mnastalski-baselinker-php)[thunderer/numbase

Convert any number between arbitrary bases

242.3k](/packages/thunderer-numbase)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
