Skip to content
forked from jifei/Pinyin

最好用的PHP汉字转拼音类,支持获取汉字的拼音以及拼音的缩写,能准确匹配6千多个汉字。

Notifications You must be signed in to change notification settings

songweihang/Pinyin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pinyin

最简单、最准确的PHP中文转拼音的类

支持获取拼音以及拼音的缩写即首字母

支持utf-8、gbk等编码

能准确匹配6千多个常用汉字

单个汉字,一句话,中英文混合都完美支持

例子utf-8版

include_once 'Pinyin.php';    
echo Pinyin::getPinyin("早上好");//获取拼音  
echo Pinyin::getShortPinyin("早上好");//获取拼音缩写  

例子gbk版

include_once 'Pinyin.php';
echo Pinyin::getPinyin("早上好",'gb2312');//获取拼音
echo Pinyin::getShortPinyin("早上好",'gb2312');//获取拼音缩写

About

最好用的PHP汉字转拼音类,支持获取汉字的拼音以及拼音的缩写,能准确匹配6千多个汉字。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%