PHPackages                             zhouyu/tree - 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. zhouyu/tree

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

zhouyu/tree
===========

php无限级分类

1.5(7y ago)176MITPHP

Since Nov 1Pushed 7y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (7)Used By (0)

tree
====

[](#tree)

php无限级分类

```
$array = [

];

```

获取一个附加层级的一维数组

```
Tree::getArray($array)

```

获取一个树形数组

```
Tree::getTree($array)

```

传递一个父级分类ID返回所有子分类ID

```
Tree::getChildsId($array,$pid)

```

传递一个父级分类ID返回所有子分类数组

```
Tree::getChilds($array,$pid)

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 64.3% 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 ~6 days

Total

6

Last Release

2766d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ca0d0bb99c57f4b501577c26f1be6b5546c4bca67c9d238b5ec9e50fc355924?d=identicon)[zhoutianyunmei](/maintainers/zhoutianyunmei)

---

Top Contributors

[![coderzhouyu](https://avatars.githubusercontent.com/u/8733357?v=4)](https://github.com/coderzhouyu "coderzhouyu (9 commits)")[![niklauslu](https://avatars.githubusercontent.com/u/10938792?v=4)](https://github.com/niklauslu "niklauslu (5 commits)")

### Embed Badge

![Health badge](/badges/zhouyu-tree/health.svg)

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

###  Alternatives

[illuminate/redis

The Illuminate Redis package.

8314.6M369](/packages/illuminate-redis)[nosto/module-nostotagging

Increase your conversion rate and average order value by delivering your customers personalized product recommendations throughout their shopping journey.

27703.7k4](/packages/nosto-module-nostotagging)[michaeljennings/refinery

A php class to refine data into a set format.

1210.5k2](/packages/michaeljennings-refinery)[telephantast/message-bus

Thesis Message Bus

162.4k6](/packages/telephantast-message-bus)

PHPackages © 2026

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