77 Star 224 Fork 66

mz / php-pinyin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.php 1017 Bytes
一键复制 编辑 原始数据 按行查看 历史
mz 提交于 2016-10-09 01:01 . fix make tool bug
<?php
header('Content-Type: text/html; charset=utf-8');
define('NL', "<br><Br>\r\n");
include 'pinyin.class.php';
$str = '做法是默认的编码方式。对于英-文-文-件是ASCII编码,对于简体中文文件是GB2312编码..(只针对Windows简体中文版,如果是繁体中文版会采用Big5码)魍魉,交媾,蒯草';
echo "原文:", NL;
echo $str, NL;
$time = microtime(1);
echo "默认模式:", NL;
echo pinyin::get($str, 0, '', '-'), NL;
echo '<!--' . (microtime(1) - $time) . '-->', NL;
$time = microtime(1);
echo "全拼音+带分隔线:", NL;
echo pinyin::get($str, 0, '-'), NL;
echo '<!--' . (microtime(1) - $time) . '-->', NL;
$time = microtime(1);
echo "拼音首字母+带分隔线:", NL;
echo pinyin::get($str, 1, '-'), NL;
echo '<!--' . (microtime(1) - $time) . '-->', NL;
$time = microtime(1);
echo "拼音首字母+保留某些字符(,和.):", NL;
echo pinyin::get($str, 1, '-', ',\.'), NL;
echo '<!--' . (microtime(1) - $time) . '-->', NL;
?>
PHP
1
https://gitee.com/mz/php-pinyin.git
git@gitee.com:mz/php-pinyin.git
mz
php-pinyin
php-pinyin
master

搜索帮助