【发布时间】:2017-01-04 07:32:45
【问题描述】:
我正在开发一个小型网站,并在使用 PHP 的 include() 函数时包含标题。然而,就在从包含引入的任何代码之前,页面上有这个奇怪的。
这是发生它的页面的代码
<!DOCTYPE html>
<html>
<head>
<title>Things and Stuff | Source Files</title>
<!-- Style Sheets/Scripts/Misc Stuff -->
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="css/gmod.css">
<link rel="stylesheet" type="text/css" href="css/alerts.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="scripts/cycle.js"></script>
</head>
<body>
<?php include('./utilities/header.php'); ?>
<!-- rest of the page from here down... -->
使用解决方案编辑
感谢下面的帮助,我想通了。 为了解决这个问题,我在 Notepad++ 中打开了文件,将其设置为 PHP,然后在顶部的 Encoding 下选择了 ANSI(发现 = 为 UTF-8 w/o BOM),它就可以工作了!
【问题讨论】:
-
请显示头文件的内容。
-
必须在头文件中