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: