PHPackages                             fengqi/hanzi - 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. fengqi/hanzi

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

fengqi/hanzi
============

获取汉字的拼音, 或者简繁体转换.

v0.1.4(4y ago)6314.4k↓53.3%172MITPHP

Since Jan 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/fengqi/hanzi)[ Packagist](https://packagist.org/packages/fengqi/hanzi)[ Docs](https://github.com/fengqi/hanzi)[ RSS](/packages/fengqi-hanzi/feed)WikiDiscussions master Synced today

READMEChangelog (4)DependenciesVersions (5)Used By (2)

Hanzi
=====

[](#hanzi)

获取汉字的拼音, 或者简繁体转换

安装方法
====

[](#安装方法)

命令行下, 执行 composer 命令安装:

```
composer require fengqi/hanzi

```

使用示例
====

[](#使用示例)

```
use fengqi\Hanzi\Hanzi;

$chs = '中国人';
$cht = '中國人';

// 简繁体获取拼音
var_dump(Hanzi::pinyin($chs));
var_dump(Hanzi::pinyin($cht));

// 简繁体转换
var_dump(Hanzi::turn($chs));
var_dump(Hanzi::turn($cht, true));

```

关于部分无法正确转换
==========

[](#关于部分无法正确转换)

> 可以自行补充 src/ 下 Dict.php 中的字典

关于多音字
=====

[](#关于多音字)

> 暂不支持

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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 ~677 days

Total

4

Last Release

1789d ago

### Community

Maintainers

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

---

Top Contributors

[![fengqi](https://avatars.githubusercontent.com/u/517708?v=4)](https://github.com/fengqi "fengqi (21 commits)")[![lyf362345](https://avatars.githubusercontent.com/u/9997434?v=4)](https://github.com/lyf362345 "lyf362345 (2 commits)")[![icelemon1314](https://avatars.githubusercontent.com/u/4556804?v=4)](https://github.com/icelemon1314 "icelemon1314 (1 commits)")

---

Tags

Pinyinhanzijiantifanti

### Embed Badge

![Health badge](/badges/fengqi-hanzi/health.svg)

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

###  Alternatives

[overtrue/pinyin

Chinese to pinyin translator.

4.5k6.9M78](/packages/overtrue-pinyin)[thl/pinyin

Romanization tool for Traditional Chinese

2520.1k](/packages/thl-pinyin)[xiaodi/think-pinyin

ThinkPHP 中文转拼音扩展包

344.8k](/packages/xiaodi-think-pinyin)[lokielse/laravel-pinyin

Chinese Pinyin Bundle For Laravel

1613.9k](/packages/lokielse-laravel-pinyin)

PHPackages © 2026

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