$str = '华南'; 改成$str = '华南';也没用。
解决方案 »
- eclipse php版本中怎么快捷键到定义的class和function
- php与mysql的配置问题
- 如何在注册发生错误时保留用户信息,进来就给分
- 刚刚我提了这个问题,但是高手们还是没有解决问题?在线等候…………
- php读xml问题
- setcookie好象会延迟:$_T = time( ); setcookie( '_T', $_T ); print $_COOKIE[ '_T' ]; 第一次是空,第二次是第一次的值。
- php绘图,请高人修改。。
- 再问一个目录读取的问题...急........谢谢.......
- 关于数据还原的问题
- 关于使用MYSQL的问题?
- 大家帮看看,有几个问题。
- 关于循环输出数据库记录的问题.急求解!!!!!!!!!!!!!
function utf8_replaceEntity($result){
$value = (int)$result[1];
$string = '';
$len = round(pow($value,1/8));
for($i=$len;$i>0;$i--){
$part = ($value & (255>>2)) ¦ pow(2,7);
if ( $i == 1 ) $part ¦= 255 <<(8-$len);
$string = chr($part) . $string;
$value >>= 6;
}
return $string;
} function utf8_html_entity_decode($string){
return preg_replace_callback(
'/&#([0-9]+);?/u',
'utf8_replaceEntity',
$string
);
}
$string = '华南';
$str = '华南';
$string = utf8_html_entity_decode($string);
echo iconv("UTF-8", "GB2312", $string);
$str = utf8_html_entity_decode($str);
echo iconv("UTF-8", "GB2312", $str); 怎么不小心点
Array
(
[0] => 华南
[1] => SL01088
[2] => 广州世裕汽车贸易有限公司
[3] => ACTYON
[4] => A200XDi[2006]
[5] => 爱腾A200XDi
[6] => GREY
[7] => 灰色
[8] => LAK
[9] => 经典黑
[10] => AH
[11] => KPTC0B1K97P039397
[12] => 255000
[13] => 周婧芝
[14] => 2008-03-01
)
$str="";
if ($c < 0x80) {
$str.=chr($c);
} else if ($c < 0x800) {
$str.=chr(0xC0 | $c>>6);
$str.=chr(0x80 | $c & 0x3F);
} else if ($c < 0x10000) {
$str.=chr(0xE0 | $c>>12);
$str.=chr(0x80 | $c>>6 & 0x3F);
$str.=chr(0x80 | $c & 0x3F);
} else if ($c < 0x200000) {
$str.=chr(0xF0 | $c>>18);
$str.=chr(0x80 | $c>>12 & 0x3F);
$str.=chr(0x80 | $c>>6 & 0x3F);
$str.=chr(0x80 | $c & 0x3F);
}
return iconv('UTF-8', 'GB2312', $str);
}