GBK-> Pinyin PHP class

xiaoxiao2021-03-06  81

TONE = $ Tone;} Function setFormat ($ hEAD, $ FORMAT, $ FOOT) {$ this-> head = $ head; $ this-> format = $ format; $ this-> foot = $ foot;} function render ($ STR, $ ASCII = FALSE) {IF ($ ASCII) Return Str_Replace ("% 1", $ Str, Str_Replace ("% 2", $ Str, $ this-> format); if (preg_match ("/ ^ "$ str." ([0-9A-ZA-Z] ) / IM ", $ THIS-> DATA, $ regs) $ Pinyin = $ regs [1]; Else $ Pinyin = $ Str." "; RETURN STR_REPLACE ("% 1 ", $ STR, STR_REPLACE ("% 2 ", $ THIS-> TONE? $ Pinyin: Substr ($ Pinyin, 0, -1), $ this-> format);} Fun Curation Parse ($ Str) {$ output = ""; $ length = Strlen ($ STR); $ output. = $ this-> head; for ($ i = 0; $ i render ($ STR [$ I], true); Break;} $ code1 = ORD ($ STR [$ I]); $ Code2 = ORD ($ STR [$ I 1]); if ($ code1 == 0x0d && $ code2 == 0x0a) {$ output. = $ this-> foot; $ output. = $ this-> head; $ I;

转载请注明原文地址:https://www.9cbs.com/read-97938.html

New Post(0)