多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~ /** * 简体转繁体 * @param $Text */ function gbk_to_big5($Text) { global $GB_DATA; if(empty($GB_DATA)) { $filename = CODETABLEDIR.'gb-big5.table'; $fp = fopen($filename, 'rb'); $gb = fread($fp, filesize($filename)); fclose($fp); } $max = strlen($Text)-1; for($i = 0; $i < $max; $i++) { $h = ord($Text[$i]); if($h >= 0x80) { $l = ord($Text[$i+1]); if($h==161 && $l==64) { $big = ' '; } else { $p = ($h-160)*510+($l-1)*2; $big = $GB_DATA[$p].$GB_DATA[$p+1]; } $Text[$i] = $big[0]; $Text[$i+1] = $big[1]; $i++; } } return $Text; } ~~~