php-pinyin

码农软件 · 软件分类 · 拼音转换工具包 · 2019-08-04 10:59:05

软件介绍

php 支持中文汉字转拼音单元(支持生僻字)。

之前用的汉字转拼音单元 已经不能满足需求了,自己重新整理+优化了一下。

方式:先用gbk判断码表,取不到的字用生僻字字典。

(需要 php-mb_string 扩展支持)

方法:

class pinyin{
// $str : 需要转换的汉字(只支持utf-8)
// $first_char : 是否只取首字母
// $split_char : 生成每个字间的分隔符
static function get($str, $first_char = 0, $split_char = '')
}

例:

$str = '是默认的编码方式。对于英文文件是ASCII编码,对于简体中文文件是GB2312编码(只针对Windows简体中文版,如果是繁体中文版会采用Big5码)魍魉,交媾,蒯草';

// 默认模式
pinyin::get($str), NL;

// 全拼音+带分隔线
pinyin::get($str, 0, '-'), NL;

// 拼音字母+带分隔线
pinyin::get($str, 1, '-'), NL;

本文地址:https://codercto.com/soft/d/11616.html

Django 1.0 Template Development

Django 1.0 Template Development

Scott Newman / Packt / 2008 / 24.99

Django is a high-level Python web application framework designed to support the rapid development of dynamic websites, web applications, and web services. Getting the most out of its template system a......一起来看看 《Django 1.0 Template Development》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具