PHPackages                             fizzday/fizzternary - 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. fizzday/fizzternary

ActiveLibrary

fizzday/fizzternary
===================

a ternary tree calculation for php (php实现的三叉树算法,33复制)

0192PHP

Since Feb 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/fizzday/FizzTernary)[ Packagist](https://packagist.org/packages/fizzday/fizzternary)[ RSS](/packages/fizzday-fizzternary/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

FizzTernary
===========

[](#fizzternary)

a ternary tree with php (分销33复制php三叉树算法)

installation (安装)
-----------------

[](#installation-安装)

- 直接使用composer命令

```
composer require fizzday/fizzternary

```

- 或者写入composer.json

```
{
    "require": {
        "fizzday/fizzternary": "dev-master"
    }
}

```

usage samples (使用示例)
--------------------

[](#usage-samples-使用示例)

### 示例

[](#示例)

```
1
2     3      4
5 6 7 8 9 10 11 12 13

```

### 1. getLayers($id)

[](#1-getlayersid)

```
use Fizzday\FizzTernary\FizzTernary;

$id = 19;
$res = FizzTernary::getLayers($id);
print_r($res);

```

result (返回第几层)

```
4

```

> param comment (参数说明)

- `$id` 编号

variable field (变量字段)

```
id: 编号

```

### 2. getPids($id, $layers=0)

[](#2-getpidsid-layers0)

```
use Fizzday\FizzTernary\FizzTernary;

$id = 19;
$res = FizzTernary::getPids($id);
print_r($res);

```

result (匹配结果)

```
Array
(
    [0] => 6
    [1] => 2
    [2] => 1
)

```

> param comment (参数说明)

- `$id` 编号
- `$layers` 限定层数

return field (返回字段)

```
返回上层人的编号

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6bf4b5e54116809f8cbbc87aa57529e8c4227ea3f51ae9bdf70249044f32195?d=identicon)[fizz](/maintainers/fizz)

### Embed Badge

![Health badge](/badges/fizzday-fizzternary/health.svg)

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

PHPackages © 2026

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