PHP漢字轉拼音類

最簡單、最準確的PHP中文轉拼音的類 github項目地址:https://github.com/jifei/Pinyinphp

支持獲取拼音以及拼音的縮寫即首字母git

支持utf-八、gbk等編碼github

能準確匹配6千多個經常使用漢字編碼

單個漢字,一句話,中英文混合都完美支持code

例子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');//獲取拼音縮寫
utf-8

相關文章
相關標籤/搜索