网页文字简繁转换函数
时间:2006-02-16 来源:瘦死的骆驼
作者:caocao
=2) {
$code=strtok($code,"");
if ((ord($code[0]) = 247)) {
return (0);
}
else {
if ((ord($code[1]) = 254)) {
return (0);
}
else {
return (1);
}
}
}
else{
return (1);
}
}
function gboffset($code) {
if (strlen($code) >= 2) {
$code=strtok($code,"");
return ((ord($code[0]) - 161) * 94 + (ord($code[1]) - 161));
}
else {
return(-1);
}
}
function wordtostring($code) {
return (chr(hexdec(substr($code,0,2))).chr(hexdec(substr($code,2,2))));
}
function gbtobig5($code) {
include "data_gb.php";
$output="";
$length=strlen($code);
$code=strtok($code,"");
$idx=0;
while ($idx = 0)||($offset
使用方法:
1. 将以上代码另存为gbtobig5.php
2. 在需要的页面引入gbtobig5.php
3. 对目标字段套用函数,实现格式化输出
相关阅读 更多 +