谁有简繁转换的类? http://community.csdn.net/Expert/topic/3489/3489024.xml?temp=2.598208E-02 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这有,我试过,很方便http://bt.ydy.com/caocao/program/php/index.php?language=cn <?/*********************************************************************** Written by caocao [email protected] http://nethermit.yeah.net 简体中文转换为繁体中文类 使用方法: $convert=new gtob; $str=$convert->gbtobig5($str);***********************************************************************/class gtob{ var $data; function gbtobig5($str) { $output=""; $length=strlen($str); for ($i=0;$i<$length;++$i) { if ($i==$length-1) { $output.=$str[$i]; break; } $code1=ord($str[$i]); $code2=ord($str[$i+1]); if ($code1>=0x81&&$code1<=0xFE&&$code2>=0x40&&$code2<=0xFE&&$code2!=0x7F) { $offset=($code1-0x81)*190; $offset+=$code2>0x7F?$code2-0x41:$code2-0x40; $offset<<=1; $output.=substr($this->data, $offset, 2); ++$i; } else $output.=$str[$i]; } return $output; }//#######未完待续 太长了,写不下。你还是自己去下吧。http://bt.ydy.com/caocao/program/viewsource.php?language=cn&id=1 如何实现图片中的操作(删除/修改) Mysql远程链接问题 正则preg_match_all怎样匹配[img]? 求网址过滤正则 php中用Ajax提交查询的数据没有和数据库同步 一个DIV+CSS的中国地图 第一次用PHP,请教一个类调用的实例? 将ansi格式存储的文件转为utf-8 (php) 哪些个人主页比较优秀,请推荐一观 对一个php foreach的疑问,请高手指点 radio分组的问题!在线等! IPB中文HyPER版在php5+apache1.3.28下的奇怪问题
http://bt.ydy.com/caocao/program/php/index.php?language=cn
/***********************************************************************
Written by caocao
[email protected]
http://nethermit.yeah.net
简体中文转换为繁体中文类
使用方法:
$convert=new gtob;
$str=$convert->gbtobig5($str);
***********************************************************************/
class gtob
{
var $data;
function gbtobig5($str)
{
$output="";
$length=strlen($str);
for ($i=0;$i<$length;++$i)
{
if ($i==$length-1)
{
$output.=$str[$i];
break;
}
$code1=ord($str[$i]);
$code2=ord($str[$i+1]);
if ($code1>=0x81&&$code1<=0xFE&&$code2>=0x40&&$code2<=0xFE&&$code2!=0x7F)
{
$offset=($code1-0x81)*190;
$offset+=$code2>0x7F?$code2-0x41:$code2-0x40;
$offset<<=1;
$output.=substr($this->data, $offset, 2);
++$i;
}
else
$output.=$str[$i];
}
return $output;
}//#######未完待续