亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術(shù)文章
文章詳情頁

繁體中文轉(zhuǎn)換為簡體中文的PHP函數(shù)

瀏覽:2日期:2024-01-01 17:01:15
前幾天我在oso論壇上問有沒有這個源程序,沒人回復。終于下定決心移植一個這樣的函數(shù),感謝網(wǎng)友Keyes提供移植用的Delphi源代碼。其調(diào)用方式為$txt=big5togb($txt)。 ;;;;(注:源代碼中的include "data_big5.php";這個文件在就是一個數(shù)組,在http://caocao.oso.com.cn/data_big5.zip,請編輯下載到oso上,做一個鏈接,因為這個文件我過幾天就要刪除了。) <? /*********************************************************************** ;;;;;;;Written by caocao ;;;;;;;[email protected] ;;;;;;;http://caocao.oso.com.cn ;;;;;;;With the help of Keyes ;;;;;;;[email protected] ;;;;;;;http://my-wjl.scu.edu.cn/~Keyes ***********************************************************************/ function isbig5($code) { ;;if (strlen($code)>=2) ;;{ ;;;;$code=strtok($code,""); ;;;;;;;;;if (ord($code[0]) < 161) ;;;;{ ;;;;;;return (0); ;;;;} ;;;;else ;;;;{ ;;;;;;if (((ord($code[1]) >= 64)&&(ord($code[1]) <= 126))||((ord($code[1]) >= 161)&&(ord($code[1]) <= 254))) ;;;;;;{ return (1); ;;;;;;} ;;;;;;else ;;;;;;{ return (0); ;;;;;;} ;;;;} ;;} ;;else ;;{ ;;;;return (0); ;;} } function big5offset($code) { ;;if (strlen($code) >= 2) ;;{ ;;;;$code=strtok($code,""); ;;;;if ((ord($code[1]) >= 64)&&(ord($code[1]) <= 126)) ;;;;{ ;;;;;;return ((ord($code[0]) - 161) * 157 + (ord($code[1]) - 64)); ;;;;} ;;;;if ((ord($code[1]) >= 161)&&(ord($code[1]) <= 254)) ;;;;{ ;;;;;;return ((ord($code[0]) - 161) * 157 + 63 + (ord($code[1]) - 161)); ;;;;} ;;} ;;return (-1); } function wordtostring($code) { ;;return (chr(hexdec(substr($code,0,2))).chr(hexdec(substr($code,2,2)))); } function big5togb($code) { ;;include "data_big5.php";$output="";$length=strlen($code); ;;$code=strtok($code,""); ;;$idx=0; ;;while ($idx < $length) ;;{ ;;;;$tmpStr=$code[$idx].$code[$idx+1]; ;;;;;;;;;if (isbig5($tmpStr)) ;;;;{ ;;;;;;$offset=big5offset($tmpStr); ;;;;;;if (($offset >= 0)||($offset <= 14757)) ;;;;;;{ $output.=wordtostring($big5order[$offset]); $idx++; ;;;;;;} ;;;;;;else ;;;;;;{ $output.= $code[$idx]; ;;;;;;} ;;;;} ;;;;else ;;;;{ ;;;;;;$output.= $code[$idx]; ;;;;} ;;;;$idx++; ;;} ;;return ($output); } ?>;;【本文版權(quán)歸作者與奧索網(wǎng)共同擁有,如需轉(zhuǎn)載,請注明作者及出處】;;;;
標簽: PHP
主站蜘蛛池模板: 黄色小视频在线播放 | 中文字幕日韩欧美 | 国产成人宗合 | 亚洲国产欧美日韩第一香蕉 | 老外一级毛片免费看 | 国产亚洲欧美在线播放网站 | 98香蕉草草视频在线精品看 | 九九九热在线精品免费全部 | 91久久青青草原线免费 | 黄色网址视频在线播放 | 国产高清不卡视频在线播放 | 一级日本特黄毛片视频 | 老湿机一区午夜精品免费福利 | 国产成人精品一区二区三在线观看 | 黄色a毛片| 日韩不卡免费视频 | 久久久精品免费热线观看 | 亚洲午夜精品久久久久久成年 | 久久成人国产精品免费 | 国产青榴社区91精品 | 国产精品对白交换绿帽视频 | 一级黄色欧美 | 久久久久无码国产精品一区 | 国产一在线观看 | 一级黄色大毛片 | 国产一级做a爰片久久毛片 国产一级做a爰片久久毛片99 | 无需付费大片免费在线观看 | 久久中文字幕不卡一二区 | 成人精品区 | 久久人人网 | 国产精品人伦久久 | 韩国主播vip福利视频在线播放 | 国产精欧美一区二区三区 | 国产一区二区不卡免费观在线 | 欧美日韩国产在线 | 日韩在线视频一区二区三区 | 一级免费毛片 | xxxxxxx免费 | 国产99精品在线观看 | 大学生一级毛片免费看真人 | 婷婷久月|