一共两个文件:
A,index.php文件的代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<?php
require("/title.php");
?>
</head><body>
...test.....
</body>
</html>B,title.php文件的代码:<?php
header(“Content-Type: text/html; charset=utf-8")
?>
<title>中文标题(beta 1.0)----Powered by Aloesky</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<link href="../css/menu.css" rel="stylesheet" type="text/css" />
在PHP环境中测试,上文中“中文标题”这几个字变成乱码了,无论怎么声明UTF-8都无效求大神们赐教
A,index.php文件的代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<?php
require("/title.php");
?>
</head><body>
...test.....
</body>
</html>B,title.php文件的代码:<?php
header(“Content-Type: text/html; charset=utf-8")
?>
<title>中文标题(beta 1.0)----Powered by Aloesky</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<link href="../css/menu.css" rel="stylesheet" type="text/css" />
在PHP环境中测试,上文中“中文标题”这几个字变成乱码了,无论怎么声明UTF-8都无效求大神们赐教
另外,你的php文件也要是utf-8编码
我原本写了这句,让HTML执行就行了,这样不行吗:
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />