PHPackages                             liupei/phptools - 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. liupei/phptools

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

liupei/phptools
===============

some tools for php

0.7(5y ago)0139MITPHPPHP ^7.0CI failing

Since Feb 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/zjlsliupei/phptools)[ Packagist](https://packagist.org/packages/liupei/phptools)[ RSS](/packages/liupei-phptools/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

### 介绍

[](#介绍)

封装php常用工具

- Arrays.php 数组相关操作
- Code.php 编码相关操作
- Url.php Url相关操作
- Id.php Id生成，解析
- String.php 字符串相关操作

### Arrays操作

[](#arrays操作)

```
$arr2 = [
    [
        "key"=>1,
        "name"=>'name1'
    ]
];
$_arr2 = \liupei\phptools\Arrays::array2SetKey($arr2, 'key');
var_dump($_arr2);
//$arr2 = [
//    1 => [
//        "key"=>1,
//        "name"=>'name1'
//    ]
//];
```

### Url操作

[](#url操作)

实例化

```
$url = new \liupei\phptools\Url('http://www.baidu.com/index.php?name=liupei&age=18#task?id=1&back_url=ddd');
```

增加query参数

```
$url->addQuery("param1", "value1");
```

增加FragmentQuery参数

```
$url->addFragmentQuery("param1", "value1");
```

构建url

```
$urlStr = $url->buildUrl();
```

### Id操作

[](#id操作)

生成唯一id

```
$id = \liupei\phptools\Id::createUniqueId();
var_dump($id);
```

### String操作

[](#string操作)

判断一个字符串是否在另一个字符串中

```
$needel = 'a';
$haystack = 'a,b';
$in = \liupei\phptools\String::inString($needel,$haystack);
var_dump($in);
// true
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~51 days

Recently: every ~73 days

Total

7

Last Release

1966d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9744c071fc6a77b11442cc67fdab6432fb42c0ba8866d7443870f9b1cb39695c?d=identicon)[liupei](/maintainers/liupei)

---

Top Contributors

[![zjlsliupei](https://avatars.githubusercontent.com/u/33270110?v=4)](https://github.com/zjlsliupei "zjlsliupei (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/liupei-phptools/health.svg)

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

PHPackages © 2026

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