Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

Pinyin

> 编程语言
Open source

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

342 stars0 likes0 views
WebsiteGitHub

About

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

Pinyin

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

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

支持utf-8、gbk等编码

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

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

例子utf-8版

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

例子gbk版

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

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHP

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言