PHP supports the development of Chinese characters to pinyin with uncommon characters

Source: Internet
Author: User
Tags php class
In our last class, we introduced the example of the first letter implementation of the PHP kanji to be shared, then in our Chinese language there is an uncommon word, uncommon word is also called obscure word, refers to the uncommon or unfamiliar Chinese characters. Since the Chinese characters, Chinese characters are also constantly evolving and changing, then today we will introduce PHP support for the implementation of the rare word conversion to pinyin!

The first step, the first download we need to use this lesson PHP support for rare characters to Pinyin class library: http://www.php.cn/xiazai/leiku/741

The second step, after the download, find the PHP class files we need, unzip to our local directory, create a new PHP file!

After the third step, we will call this class in the new PHP file, and instantiate the class:

<?phpinclude_once "codehanzi.php";//Introduction File $py = new Py_class ();        Instantiate class//Output    echo $py-str2py ("Bayan-shi"). " <br> ";    Echo $py-str2py ("PHP Chinese Web"). " <br> ";    Echo $py-str2py ("Kobe Sanraku 叅 mitsu cloudy Sky 亝");? >

The results of the operation are as follows:

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.