0

我正在尝试使用include_once类似

<?php include_once "emailform.html"; ?>

但是 PHP 没有将其包含在 html 代码中,而是将其作为简单文本包含在内,并且输出看起来像

��<div class="well widget"> <div class="widget-header"> <h3 class="title">'O1/H�� ,3 �' F'E</h3> 

有什么帮助吗?

4

4 回答 4

2

include_once()不是因为你在做什么。用于readfile()输出html的内容:

readfile('yourhtml.html');
于 2013-07-03T12:05:24.097 回答
1

我认为你必须摆脱BOM

于 2013-07-03T12:14:10.893 回答
0

包含 HTML 内容的更好方法可能是http://php.net/manual/en/function.file-get-contents.php

于 2013-07-03T12:10:51.777 回答
0

您的 .html 文件可能未以UTF-8编码。在编辑器中打开它并确保它保存为UTF-8

于 2013-07-03T12:06:03.277 回答