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

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

codecible/yii2-chinesepinyin
============================

The chinesepinyin integration for the Yii framework

3.0.1(2y ago)04BSD-3-ClausePHP

Since Mar 4Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (4)Used By (0)

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

[](#yii2-chinesepinyin)

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

安装方法
====

[](#安装方法)

1.命令安装

```
php composer.phar require codecible/yii2-chinesepinyin

或
composer require codecible/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

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~768 days

Total

3

Last Release

1091d ago

Major Versions

1.1 → 3.02023-05-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/80761b1426d76486011ef70db3fe3b002a1f5203714b9ffe2295154b432d3d35?d=identicon)[codecible](/maintainers/codecible)

---

Top Contributors

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

---

Tags

helperyii2Pinyinchinesepinyin

### Embed Badge

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

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

PHPackages © 2026

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