我有一个文件 test.php 包含,这个:
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php include('text.html'); ?>
</body>
</html>
包含的文件包含带有各种 html 标签的 html 格式文本。执行 test.php 时,包含的文本被显示,但 html 标记未格式化输出,但像在源中一样可见。另外,utf-8 特殊字符未正确显示
示例:�h3> (1880, Bucure_ti - 1970, Bucure_ti)</h3> <�P>
如果我不使用包含但我只是将包含文件的内容直接粘贴到源代码中,则输出很好。我还尝试使用在此站点上找到的以下代码,而不是包含,但结果是相同的:
<?php
$f = fopen("bio.php", "r");
// Read line by line until end of file
while(!feof($f)) {
echo fgets($f) . "<br />";
}
fclose($f);
?>
What is wrong ?``