网页文字简繁转换函数
<?
function isgb($code)
{
if (strlen($code)>=2)
{
$code=strtok($code,"");
if ((ord($code[0]) < 161)||(ord($code[0]) >= 247))
{
return (0);
}
else
{
if ((ord($code[1]) <= 161)||(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)
补充:Php教程,Php常用代码