最好用的PHP汉字转拼音类:Pinyin

WBOY
Release: 2016-06-20 12:53:59
Original
2176 people have browsed it

Pinyin

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

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

支持utf-8、gbk等编码

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

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

例子utf-8版

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

例子gbk版

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

项目主页:http://www.open-open.com/lib/view/home/1435299355872

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!