Home  >  Article  >  Backend Development  >  谁有php 汉字转拼音的 代码

谁有php 汉字转拼音的 代码

WBOY
WBOYOriginal
2016-06-06 20:46:111108browse

谁有php 汉字转拼音的 代码

要能识别同音字

回复内容:

谁有php 汉字转拼音的 代码

要能识别同音字

多音字很难搞定的~
github上看到的https://github.com/ohfang/HanziToPinyin,你参考下

拿 Google 翻译转,如这个

<code>>>> trs '{zh-CN=@zh}' 张长江长个儿了
Zhāngchángjiāng zhǎng gè'erle 
</code>

不考虑多音字汉字转拼音的代码:https://gist.github.com/lizheming/11166530

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn