PHP kanji to pinyin [contains 20,902 basic Chinese characters +5059 uncommon words]

Source: Internet
Author: User
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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.