【发布时间】:2014-02-16 16:03:27
【问题描述】:
我正在尝试打印或回显其他语言文本,但它不起作用!!! 我尝试了 utf8 编码或解码,但它不起作用! 有人可以帮忙吗? 谢谢。
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>zura</title>
</head>
<body>
<?PHP
header('content-type: text/html; charset=utf-8');
include 'includes/connection.php';
$query = "SELECT * FROM chiragdani.children;";
mysql_select_db('chiragdani',$conn);
$result = mysql_query($query);
while($rows = mysql_fetch_array($result))
{
print "<p>". mb_substr($rows['ChildID'], 0, 10000, "UTF-8").' '.$rows ['ChildName'].$rows['ChildLastName'].' '."</p>" ;
}
?>
</body>
</html>
【问题讨论】:
-
您为 HTML 定义的编码是什么?
-
感谢您的回复,但它不起作用...
-
您的数据库连接是 UTF-8 吗?你的数据库是?你的专栏?你的数据?如果您不使用已弃用的
mysql_函数,而是使用 PDO,您将能够更轻松地定义这种方式。 -
html输出后无法发送header