allovince/evapinyin

A Pinyin transform lib

dev-master 2014-05-14 04:56 UTC

This package is not auto-updated.

Last update: 2024-11-09 16:21:58 UTC


README

A simple Chinese characters to pinyin lib. Original Author is Kin(Mr.kin@foxmail.com), modified by AlloVince for support PSR-2 and Composer.

All including 20850 Chinese characters. This lib NOT ABLE to handle polyphone. Only support UTF-8.

Usage

$pinyin = new EvaPinyin\Pinyin();
echo $pinyin->transformWithTone('拼音');
//pīn yīn

echo $pinyin->transformWithoutTone('拼音', ' ');
//pin yin

echo $pinyin->transformUcwords('拼音');
//PY

Install

Add below line to your composer.json

"allovince/evapinyin": "dev-master",