Score
0
Watch 74 Star 186 Fork 49

mz / php-pinyinPHP

Join us
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
php 汉字转拼音单元(支持生僻字) spread retract

Clone or download
test.php 1017 Bytes
Copy Edit Web IDE Raw Blame History
mz authored 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;
?>

Comment ( 0 )

Sign in for post a comment

PHP
1
https://gitee.com/mz/php-pinyin.git
git@gitee.com:mz/php-pinyin.git
mz
php-pinyin
php-pinyin
master

Help Search