Php 显示包含双字节字符的Mysql结果

Php 显示包含双字节字符的Mysql结果,php,Php,我有以下内容来显示mysql查询的结果 while ($row= mysql_fetch_array($result)) { // Switch the background colour $bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee'); echo '<tr bgcolor="' . $bg . '"> <td align="left">' . '<p>' . $row['timesta

我有以下内容来显示mysql查询的结果

while ($row= mysql_fetch_array($result)) {
  // Switch the background colour
    $bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee');
    echo '<tr bgcolor="' . $bg . '">
    <td align="left">' . '<p>' . $row['timestamp']  . '</p>' . '</td>
    <td align="left">' . '<p>' . $row['title']  . '</p>' . '</td>
    <td align="left">' . '<p>' . $row['description'] . '</p>' . '</td>
    </tr>';
 }
while($row=mysql\u fetch\u array($result)){
//切换背景颜色
$bg=($bg=='eeeeeee'?'ffffff':'eeeeeee');
回声'
“.”.$row['timestamp'].

。” “.”.$row['title'..

”。' “.”.$row['description'].

。” '; }
如何显示双字节字符集(非英语)

我尝试将此添加到我的html头部,但没有成功:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


谢谢。

当您想输入或获取数据时,请确保您使用了正确的搭配和编码:

mysql_query("set names 'UTF8'");
mysql_query("set names 'latin1'"); 
在发送任何类型的输出之前,发送
内容类型
标题:

header("Content-Type: text/html; charset=utf-8");
注意:请不要使用mysql函数。使用mysqliPDO