includeonce是将html作为文本包含在内


include_once is including the html as text

我正在尝试使用类似的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> 

有什么帮助吗?

include_once()不适合您正在做的事情。使用readfile()输出html:的内容

readfile('yourhtml.html');

我认为你必须去掉BOM

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

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