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

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

guanhui07/hanzi-convert
=======================

PHP中文繁简体字转换程序，支持繁体转简体或简体转繁体

1.1.1(1y ago)03MITPHP

Since Jun 29Pushed 1y agoCompare

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

READMEChangelog (1)DependenciesVersions (4)Used By (0)

PHP 中文繁简体字转换
============

[](#php-中文繁简体字转换)

汉字中文繁简体转换，繁体转简体，简体转繁体，最全字库，共15356个

关于字库
----

[](#关于字库)

之前使用过几个繁简体转换程序，发现其内置的字库都是日常生活常用字，对于一些古诗之类的有比较多繁体字的字符串，很多繁体字无法转换，故网络收集整理了这份相对比较全的字库，共收录了15356个繁简体字（字库还在持续更新中），能够比较好的满足有较多生僻繁体字转换的需求。

安装方法
----

[](#安装方法)

推荐使用composer进行安装

```
composer require sqhlib/hanzi-convert

```

也可以下载最新的发行版本，引入src/HanziConvert.php文件即可。

使用方法
----

[](#使用方法)

```
use sqhlib\Hanzi\HanziConvert;

//繁体转简体
$str = '平時已秉班揚筆，暇處不妨甘石經。吾里忻傳日邊信，君言頻中斗杓星。會稽夫子餘詩禮，巴蜀君平舊典型。歷歷周天三百度，更參璿玉到虞廷。';
echo HanziConvert::convert($str);//默认是繁体转简体

//简体转繁体
$str = '平时已秉班扬笔，暇处不妨甘石经。吾里忻传日边信，君言频中斗杓星。会稽夫子余诗礼，巴蜀君平旧典型。歷歷周天三百度，更参璇玉到虞廷。';
echo HanziConvert::convert($str,true);//第二个参数传入布尔真则是简体转繁体

```

注意事项
----

[](#注意事项)

由于在中文中，一个简体字有的有多个繁体字写法，因此不能保证从繁体转成简体后再转成繁体和之前字形一样，后期会不断优化处理。

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance43

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 89.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 ~1213 days

Total

3

Last Release

446d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3abde3fccf025ce86670101d7cfa0641d2415c9daad93e5f0c9573a2b23ddbda?d=identicon)[guanhui07](/maintainers/guanhui07)

---

Top Contributors

[![getwebtools](https://avatars.githubusercontent.com/u/18244591?v=4)](https://github.com/getwebtools "getwebtools (17 commits)")[![guanhui07](https://avatars.githubusercontent.com/u/5820457?v=4)](https://github.com/guanhui07 "guanhui07 (2 commits)")

### Embed Badge

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

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

PHPackages © 2026

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