怎么把 华南 变成 华南?

unlive 2008-03-31 02:19:02
看源文件时里面显示的是 华南,在浏览器里查看是 华南。
我现在希望以‘华南’字样插进数字库里,怎么转变?
...全文
170 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
银熊 2008-03-31
  • 打赏
  • 举报
回复
ao
unlive 2008-03-31
  • 打赏
  • 举报
回复
3楼厉害。
搞定了,谢谢!
SysTem128 2008-03-31
  • 打赏
  • 举报
回复

<?php
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 = '华南';
$string = utf8_html_entity_decode($string);
header('Content-Type: text/html; charset=UTF-8');
echo '<li>'.$string;
?>
my_web 2008-03-31
  • 打赏
  • 举报
回复
编码转换
my_web 2008-03-31
  • 打赏
  • 举报
回复
unicode->utf-8

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧