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

The Algorithmic Beauty of Plants

The Algorithmic Beauty of Plants

Przemyslaw Prusinkiewicz、Aristid Lindenmayer / Springer / 1996-4-18 / USD 99.00

Now available in an affordable softcover edition, this classic in Springer's acclaimed Virtual Laboratory series is the first comprehensive account of the computer simulation of plant development. 150......一起来看看 《The Algorithmic Beauty of Plants》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

SHA 加密
SHA 加密

SHA 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试