改为这样试试,
$sql="insert into test(name) values('$str')";
请问你简体是用什么工具转成繁体的,怎么转成这个样的,
你可以用frontpage或金山快译等转换成这样:
$str='紀璞';这才是繁体。
$sql="insert into test(name) values('$str')";
请问你简体是用什么工具转成繁体的,怎么转成这个样的,
你可以用frontpage或金山快译等转换成这样:
$str='紀璞';这才是繁体。
一个转换函数<?
/***********************************************************************
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 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)
{
include "data_gb.php";
$output="";
$length=strlen($code);
$code=strtok($code,"");
$idx=0;
while ($idx < $length)
{
$tmpStr=$code[$idx].$code[$idx+1]; if (isgb($tmpStr))
{
$offset=gboffset($tmpStr);
if (($offset >= 0)||($offset <= 8177))
{
$output.=wordtostring($gborder[$offset]);
$idx++;
}
else
{
$output.= $code[$idx];
}
}
else
{
$output.= $code[$idx];
}
$idx++;
}
return ($output);
};
?>
你们可以试试。。挺怪的。
哪里有啊?