查看: 765|回复: 1
|
PHP Charset-->HELP
[复制链接]
|
|
<?php
$contents = array();
$temp = array();
$list_battle= array();
$contents = file_get_contents('ranking_wealth.txt');
$temp = explode("<br>",$contents);
for($i=0;$i<10;$i++){
list($name,$server,$gold) = split(",", $temp[$i]);
if($name){
$list_battle[$name]['Name'] = $name;
$list_battle[$name]['Server'] = $server;
$list_battle[$name]['Gold'] = $gold;
}
}
?>
<meta http-equiv="Content-Type" c>
<?php if($list_battle){ ?>
<table width="460" border="0" cellpadding="1" cellspacing="1" bordercolor="#CCCCCC">
<tr>
<td colspan="4" align="center"><b>W.M.O World Top 10</b></td>
</tr>
<tr>
<td align="center" width="100%" valign="top">
<table width="100%" border="1" cellspacing="2" cellpadding="1">
<tr>
<td width="40"><b>No</b></td>
<td><b> layer Name</b></td>
<td width="40" align="center"><b>Gold</b></td>
<td width="110" align="center"><b>Server</b></td>
</tr>
<?php $no = 1; ?>
<?php foreach($list_battle as $data){ ?>
<tr>
<td width="40"><?php echo $no;?></td>
<td width="270"><?php echo $data['Name'];?></td> !-->这个是utf-8
<td width="40" align="right"><?php echo $data['Gold'];?></td>
<td width="110" align="right"><?php echo $data['Server'];?></td> !-->这个是big5
</tr>
<?php $no++; } ?>
</table>
</td>
</tr>
</table>
<?php } ?>
结果output是:
W.M.O World Top 10 | No | Player Name | Gold | Server | 1 | 員外 | 842641804 | �?�Z�Q | 2 | InfernoKev | 822639464 | Chang Zhou City | 3 | 小尊 | 678327921 | �E��3�v�i | 4 | -judy- | 608135037 | �\�l�L�R | 5 | yikwen | 604200691 | �E��3�v�i | 6 | 夢心雨 | 517070474 | �E��3�v�i | 7 | -主角- | 481404250 | �?�Z�Q | 8 | Fruitie | 439190394 | Jing Yang Ridge | 9 | 風雲劍聖 | 437296644 | �\�l�L�R | 10 | 酷王李揚 | 426385946 | �?�Z�Q |
|
Server 的 乱码了
[ 本帖最后由 LyanneChan 于 13-9-2007 01:03 PM 编辑 ] |
|
|
|
|
|
|
|
发表于 15-9-2007 03:31 AM
|
显示全部楼层
为什么另一个big5的不先convert成UTF-8呢? |
|
|
|
|
|
|
| |
本周最热论坛帖子
|