> 백엔드 개발 > PHP 튜토리얼 > 한자를 병음으로 변환해주는 기능

한자를 병음으로 변환해주는 기능

WBOY
풀어 주다: 2016-07-25 09:11:39
원래의
1070명이 탐색했습니다.
한자를 병음으로 변환해주는 기능 한자를 병음으로 변환해주는 기능 한자를 병음으로 변환해주는 기능
  1. $d=array(
  2. array("a",-20319),
  3. array("ai",-20317),
  4. 배열("an",-20304),
  5. 배열("ang",-20295),
  6. 배열("ao",-20292),
  7. 배열("ba",-20283 ),
  8. array("bai",-20265),
  9. array("ban",-20257),
  10. array("bang",-20242),
  11. array("bao", -20230),
  12. 배열("bei",-20051),
  13. 배열("ben",-20036),
  14. 배열("beng",-20032),
  15. 배열("bi ",-20026),
  16. 배열("bian",-20002),
  17. 배열("biao",-19990),
  18. 배열("bie",-19986),
  19. 배열( "bin",-19982),
  20. array("bing",-19976),
  21. array("bo",-19805),
  22. array("bu",-19784),
  23. array("ca",-19775),
  24. array("cai",-19774),
  25. array("can",-19763),
  26. array("cang",-19756),
  27. 배열("cao",-19751),
  28. 배열("ce",-19746),
  29. 배열("ceng",-19741),
  30. 배열("cha",-19739) ,
  31. array("chai",-19728),
  32. array("chan",-19725),
  33. array("chang",-19715),
  34. array("chao",- 19540),
  35. array("che",-19531),
  36. array("chen",-19525),
  37. array("cheng",-19515),
  38. array("chi" ,-19500),
  39. array("chong",-19484),
  40. array("chou",-19479),
  41. array("chu",-19467),
  42. array(" chuai",-19289),
  43. array("chuan",-19288),
  44. array("chuang",-19281),
  45. array("chui",-19275),
  46. 배열 ("chun",-19270),
  47. array("chuo",-19263),
  48. array("ci",-19261),
  49. array("cong",-19249),
  50. array("cou",-19243),
  51. array("cu",-19242),
  52. array("cuan",-19238),
  53. array("cui",-19235),
  54. 배열("cun",-19227),
  55. 배열("cuo",-19224),
  56. 배열("da",-19218),
  57. 배열("dai",-19212 ),
  58. array("dan",-19038),
  59. array("dang",-19023),
  60. array("dao",-19018),
  61. array("de", -19006),
  62. 배열("deng",-19003),
  63. 배열("di",-18996),
  64. 배열("dian",-18977),
  65. 배열("diao ",-18961),
  66. array("die",-18952),
  67. array("ding",-18783),
  68. array("diu",-18774),
  69. array( "동",-18773),
  70. array("dou",-18763),
  71. array("du",-18756),
  72. array("duan",-18741),
  73. array("dui",-18735),
  74. array("dun",-18731),
  75. array("duo",-18722),
  76. array("e",-18710),
  77. array("en",-18697),
  78. array("er",-18696),
  79. array("fa",-18526),
  80. array("fan",-18518) ,
  81. array("fang",-18501),
  82. array("fei",-18490),
  83. array("fen",-18478),
  84. array("feng",- 18463),
  85. 배열("fo",-18448),
  86. 배열("fou",-18447),
  87. 배열("fu",-18446),
  88. 배열("ga" ,-18239),
  89. array("gai",-18237),
  90. array("gan",-18231),
  91. array("gang",-18220),
  92. array(" gao",-18211),
  93. array("ge",-18201),
  94. array("gei",-18184),
  95. array("gen",-18183),
  96. array ("geng",-18181),
  97. array("gong",-18012),
  98. array("gou",-17997),
  99. array("gu",-17988),
  100. array("gua",-17970),
  101. array("guai",-17964),
  102. array("guan",-17961),
  103. array("guang",-17950),
  104. 배열("gui",-17947),
  105. 배열("gun",-17931),
  106. 배열("guo",-17928),
  107. 배열("ha",-17922 ),
  108. array("hai",-17759),
  109. array("han",-17752),
  110. array("hang",-17733),
  111. array("hao", -17730),
  112. array("he",-17721),
  113. array("hei",-17703),
  114. array("hen",-17701),
  115. array("heng) ",-17697),
  116. array("홍",-17692),
  117. array("hou",-17683),
  118. array("hu",-17676),
  119. array( "huai",-17496),
  120. array("huai",-17487),
  121. array("huan",-17482),
  122. array("huang",-17468),
  123. array("hui",-17454),
  124. array("huan",-17433),
  125. array("huo",-17427),
  126. array("ji",-17417),
  127. array("jia",-17202),
  128. array("jian",-17185) ,
  129. array("jiang",-16983),
  130. array("jiao",-16970),
  131. array("jie",-16942),
  132. array("jin",- 16915),
  133. array("jing",-16733),
  134. array("jiong",-16708),
  135. array("jiu",-16706),
  136. array("ju" ,-16689),
  137. array("John",-16664),
  138. array("June",-16657),
  139. array("one",-16647),
  140. array(" if",-16474),
  141. array("or",-16470),
  142. array("right",-16465),
  143. array("right",-16459),
  144. array ("너",-16452),
  145. array("ke",-16448),
  146. array("ken",-16433),
  147. array("ken",-16429),
  148. array("kong",-16427),
  149. array("kou",-16423),
  150. array("ku",-16419),
  151. array("kua",-16412),
  152. 배열("kuai",-16407),
  153. 배열("kuan",-16403),
  154. 배열("kuan",-16401),
  155. 배열("kui",-16393 ),
  156. array("kun",-16220),
  157. array("kuo",-16216),
  158. array("la",-16212),
  159. array("lai", -16205),
  160. array("and",-16202),
  161. array("just",-16187),
  162. array("lao",-16180),
  163. array("le ",-16171),
  164. 배열("lei",-16169),
  165. 배열("leng",-16158),
  166. 배열("li",-16155),
  167. 배열( "liao",-15959),
  168. array("lian",-15958),
  169. array("liang",-15944),
  170. array("liao",-15933),
  171. array("lie",-15920),
  172. array("lin",-15915),
  173. array("ling",-15903),
  174. array("liu",-15889),
  175. 배열("long",-15878),
  176. 배열("lou",-15707),
  177. 배열("lu",-15701),
  178. 배열("lv",-15681) ,
  179. array("luan",-15667),
  180. array("lue",-15661),
  181. array("lun",-15659),
  182. array("luo",- 15652),
  183. array("if",-15640),
  184. array("may",-15631),
  185. array("and",-15625),
  186. array("which" ,-15454),
  187. array("mao",-15448),
  188. array("me",-15436),
  189. array("mei",-15435),
  190. array(" men",-15419),
  191. array("meng",-15416),
  192. array("mi",-15408),
  193. array("mian",-15394),
  194. array ("miao",-15385),
  195. array("mie",-15377),
  196. array("min",-15375),
  197. array("ming",-15369),
  198. array("miu",-15363),
  199. array("mo",-15362),
  200. array("mou",-15183),
  201. array("mu",-15180),
  202. 배열("of",-15165),
  203. 배열("of",-15158),
  204. 배열("of",-15153),
  205. 배열("of",-15150 ),
  206. array("nao",-15149),
  207. array("ne",-15144),
  208. array("nei",-15143),
  209. array("nen", -15141),
  210. array("look",-15140),
  211. array("this",-15139),
  212. array("this",-15128),
  213. array("this" ",-15121),
  214. array("niao",-15119),
  215. array("nie",-15117),
  216. array("now",-15110),
  217. array( "연도",-15109),
  218. array("new",-14941),
  219. array("new",-14937),
  220. array("new",-14933),
  221. array("nv",-14930),
  222. array("nuan",-14929),
  223. array("nude",-14928),
  224. array("nuo",-14926),
  225. 배열("o",-14922),
  226. 배열("ou",-14921),
  227. 배열("pa",-14914),
  228. 배열("pai",-14908) ,
  229. array("빵",-14902),
  230. array("빵",-14894),
  231. array("pao",-14889),
  232. array("피트",- 14882),
  233. array("pen",-14873),
  234. array("peng",-14871),
  235. array("pi",-14857),
  236. array("pian" ,-14678),
  237. 배열("발",-14674),
  238. 배열("발",-14670),
  239. 배열("핀",-14668),
  240. 배열(" ping",-14663),
  241. 배열("po",-14654),
  242. 배열("pu",-14645),
  243. 배열("qi",-14630),
  244. 배열 ("qia",-14594),
  245. array("qian",-14429),
  246. array("qiang",-14407),
  247. array("qiao",-14399),
  248. array("qie",-14384),
  249. array("qin",-14379),
  250. array("qing",-14368),
  251. array("qiong",-14355),
  252. 배열("qiu",-14353),
  253. 배열("qu",-14345),
  254. 배열("quan",-14170),
  255. 배열("que",-14159 ),
  256. array("qun",-14151),
  257. array("ran",-14149),
  258. array("rang",-14145),
  259. array("rao",-14140),
  260. array("re",-14137),
  261. array("ren",-14135),
  262. array("color",-14125),
  263. 배열("in",-14123),
  264. 배열("wrong",-14122),
  265. 배열("two",-14112),
  266. 배열("t",-14109) ,
  267. array("run",-14099),
  268. array("run",-14097),
  269. array("run",-14094),
  270. array("two",- 14092),
  271. 배열("sa",-14090),
  272. 배열("sai",-14087),
  273. 배열("san",-14083),
  274. 배열("san" ,-13917),
  275. array("sao",-13914),
  276. array("if",-13910),
  277. array("sen",-13907),
  278. array(" 연결",-13906),
  279. 배열("sha",-13905),
  280. 배열("shai",-13896),
  281. 배열("shan",-13894),
  282. 배열 ("shang",-13878),
  283. array("shao",-13870),
  284. array("she",-13859),
  285. array("shen",-13847),
  286. array("sheng",-13831),
  287. array("shi",-13658),
  288. array("shou",-13611),
  289. array("shu",-13601),
  290. 배열("shua",-13406),
  291. 배열("shuai",-13404),
  292. 배열("shuan",-13400),
  293. 배열("shuang",-13398 ),
  294. array("shui",-13395),
  295. array("shun",-13391),
  296. array("shuo",-13387),
  297. array("si", -13383),
  298. array("song",-13367),
  299. array("sou",-13359),
  300. array("su",-13356),
  301. array("suan ",-13343),
  302. array("sui",-13340),
  303. array("sun",-13329),
  304. array("suo",-13326),
  305. array( "ta",-13318),
  306. array("tai",-13147),
  307. array("and",-13138),
  308. array("only",-13120),
  309. array("tao",-13107),
  310. array("of",-13096),
  311. array("of",-13095),
  312. array("of",-13091),
  313. array("tian",-13076),
  314. array("tiao",-13068),
  315. array("tie",-13063),
  316. array("ting",-13060) ,
  317. array("barrel",-12888),
  318. array("tou",-12875),
  319. array("tru",-12871),
  320. array("true",- 12860),
  321. 배열("tui",-12858),
  322. 배열("tui",-12852),
  323. 배열("true",-12849),
  324. 배열("또는" ,-12838),
  325. array("wai",-12831),
  326. array("wan",-12829),
  327. array("wan",-12812),
  328. array(" wei",-12802),
  329. array("wen",-12607),
  330. array("weng",-12597),
  331. array("wo",-12594),
  332. array ("wu",-12585),
  333. array("xi",-12556),
  334. array("xia",-12359),
  335. array("xian",-12346),
  336. array("xiang",-12320),
  337. array("xiao",-12300),
  338. array("xie",-12120),
  339. array("xian",-12099),
  340. 배열("xiong",-12089),
  341. 배열("xiong",-12074),
  342. 배열("xiu",-12067),
  343. 배열("xu",-12058 ),
  344. array("xuan",-12039),
  345. array("xue",-11867),
  346. array("xun",-11861),
  347. array("ya", -11847),
  348. array("yan",-11831),
  349. array("yang",-11798),
  350. array("yao",-11781),
  351. array("ye ",-11604),
  352. array("yi",-11589),
  353. array("yin",-11536),
  354. array("ying",-11358),
  355. array( "yo",-11340),
  356. array("yong",-11339),
  357. array("you",-11324),
  358. array("yu",-11303),
  359. array("yuan",-11097),
  360. array("yue",-11077),
  361. array("yun",-11067),
  362. array("za",-11055),
  363. 배열("zai",-11052),
  364. 배열("zan",-11045),
  365. 배열("zang",-11041),
  366. 배열("zao",-11038) ,
  367. 배열("ze",-11024),
  368. 배열("zei",-11020),
  369. 배열("zen",-11019),
  370. 배열("zeng",- 11018),
  371. array("zha",-11014),
  372. array("zhai",-10838),
  373. array("zhan",-10832),
  374. array("zhang" ,-10815),
  375. array("zhao",-10800),
  376. array("zhe",-10790),
  377. array("zhen",-10780),
  378. array(" zheng",-10764),
  379. array("zhi",-10587),
  380. array("zhong",-10544),
  381. array("zhou",-10533),
  382. 배열 ("zhu",-10519),
  383. array("zhua",-10331),
  384. array("zhuai",-10329),
  385. array("zhuan",-10328),
  386. array("zhuang",-10322),
  387. array("zhui",-10315),
  388. array("zhun",-10309),
  389. array("zhuo",-10307),
  390. 배열("zi",-10296),
  391. 배열("zong",-10281),
  392. 배열("zou",-10274),
  393. 배열("zu",-10270 ),
  394. array("zuan",-10262),
  395. array("zui",-10260),
  396. array("zun",-10256),
  397. array("zuo",-10254)
  398. );
  399. function g($num){
  400. global $d;
  401. if($ num>0&&$num<160){
  402. return chr($num);
  403. }
  404. elseif($num<-20319||$num>-10247){
  405. return "";
  406. }else{
  407. for($i=count($d)-1;$i>=0;$i--){if($d[$i][1]<=$num) break;}
  408. return $d[$i][0];
  409. }
  410. }
  411. 함수 c($str){
  412. $ret="";
  413. for($i=0;$i $p=ord(substr($str,$i,1));
  414. if($p>160) {
  415. $q=ord(substr($str, $i,1));
  416. $p=$p*256 $q-65536;
  417. }
  418. $ret.=g($ p);
  419. }
  420. return $ret;
  421. }
  422. $hz = $_POST[hz];
  423. echo c($hz);
  424. ?>
  425. < ;form method=post>
  426. 请在此处输入中文:<입력 이름=hz>
제제대码


원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿