Home > php教程 > php手册 > 汉字取拼音(首字母,首拼,全拼)

汉字取拼音(首字母,首拼,全拼)

WBOY
Release: 2016-06-07 11:35:51
Original
1801 people have browsed it

目前比较全的汉字取拼音,市面上有的汉字都可以取到!
可自定义标点特殊字符的替换。
基于TP3.2.x,至于 \Library\Org\Util 目录可直接引用!
其它引用请自行修改!


$py = new \Org\Util\Pinyin;

echo $py->qupinyin('汉字');
--- hanzi
echo $py->qupinyin('汉字',true);
--- hz
echo $py->qupinyin('汉####字',true);
--- h____z
echo $py->qupinyin('汉####字',true,'/');
--- h////z

附件 Pinyin.class.zip ( 94.36 KB 下载:162 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template