Original: php kanji Pinyin [contains 20,902 basic Chinese characters +5059 uncommon words]
Yesterday in the conversion pinyin found a bug, there are many words can not be converted, but also can not blame him, after all, People's Coucay 8k, should only be used.
Helpless on the Internet to find the next, found an article "the most full of php Chinese pinyin function (a total of 25961 characters, including 20,902 basic Chinese characters +5059 uncommon words)"
Look at all the dick, the test is also good, can be identified, but the problem is not enough,, helpless, self-compression font (lossless compression), expand the function.
I use him pinyin.php ~ 206KB that UTF8 font, after compression expansion of the remaining 106K.
Of course, the performance of his, 10,000 pressure test, his 2.4s, after the expansion of 2.8s, only the loss of 0.4s, so it can be negligible.
No Picture no truth (test environment cpu:i5-4210m, memory 8G, win8.1, php5.5.12)
Well, the show is almost there, the following is a description of the expansion of the function bar.
Native only conversion + whether to return the first letter function.
Post-expansion support
1. return format [All: full Pinyin |first: First letter |one: first character only]
2. Placeholder for unrecognized character substitution (the original is a dead _)
3. Allowable non-Chinese characters regular control (original write Dead 0-9a-za-z, space is not supported)
Actually, it's all clear from the picture.
Okay, on the link.
Download: Pinyin.zip
PHP kanji to pinyin [contains 20,902 basic Chinese characters +5059 uncommon words]