PHPackages                             diszz/yii2-chinesepinyin - 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. diszz/yii2-chinesepinyin

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

diszz/yii2-chinesepinyin
========================

The chinesepinyin integration for the Yii framework

1.1(7y ago)022BSD-3-ClausePHP

Since Mar 4Pushed 5y agoCompare

[ Source](https://github.com/diszz/yii2-chinesepinyin)[ Packagist](https://packagist.org/packages/diszz/yii2-chinesepinyin)[ RSS](/packages/diszz-yii2-chinesepinyin/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (2)Used By (0)

yii2-chinesepinyin
==================

[](#yii2-chinesepinyin)

yii2版, 可以获取汉字的拼音

安装方法
====

[](#安装方法)

1.命令安装

```
php composer.phar require diszz/yii2-chinesepinyin
或
composer require diszz/yii2-chinesepinyin
```

代码中使用
=====

[](#代码中使用)

```
$Pinyin = new ChinesePinyin();
$str = '带声调的汉语拼音';
$ret = $Pinyin->TransformWithTone($str);
var_dump($ret);

echo '';
$str = '无声调的汉语拼音,凡芃团队';
$ret = $Pinyin->TransformWithoutTone($str);
var_dump($ret);

echo '';
$str = '首字母只包括汉字BuHanPinYin';
$ret = $Pinyin->TransformUcwordsOnlyChar($str);
var_dump($ret);

echo '';
$str = '首字母和其他字符如B区32号';
$ret = $Pinyin->TransformUcwords($str);
var_dump($ret);

string(40) "dài shēng diào de hàn yǔ pīn yīn "
string(38) "wushengdiaodehanyupinyinfanpengtuandui"
string(8) "SZMZBKHZ"
string(14) "szmhqtzfrBq32h"
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Unknown

Total

1

Last Release

2627d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27e67ef3fc9077948f53011b2f61daec02523f93a224f328cc62baca2fb5cc3e?d=identicon)[lihuixu](/maintainers/lihuixu)

---

Top Contributors

[![lihuixu](https://avatars.githubusercontent.com/u/23204636?v=4)](https://github.com/lihuixu "lihuixu (2 commits)")

---

Tags

helperyii2Pinyinchinesepinyin

### Embed Badge

![Health badge](/badges/diszz-yii2-chinesepinyin/health.svg)

```
[![Health](https://phpackages.com/badges/diszz-yii2-chinesepinyin/health.svg)](https://phpackages.com/packages/diszz-yii2-chinesepinyin)
```

PHPackages © 2026

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