I';m在两个单独的页面上使用相同的代码行,但是其中一个页面显示;而另一个没有


I'm using the same line of code on two seperate pages yet one displays  and the other doesn't?

现在我知道以前也有人问过类似的问题,但请耐心等待。所以我在两个不同的页面上使用同一行代码,但一个显示ï»?,另一个没有。是什么原因造成的?

以下代码分别出现在前面提到的两个页面上:

<?php include("footerblock.php"); ?>

这里指的是这个代码:

<?php session_start(); ?>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head><body>
<table style="text-align: center; width: 100%;" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td style="text-align: center;">
<?php
$cmtx_identifier = 'cmtx_reference';
$cmtx_reference = 'cmtx_url';
$cmtx_path = 'comments/';
require $cmtx_path . 'includes/commentics.php'; //don't edit this line
?>
</td>
</tr></tbody></table></body></html>
  1. 请不要使用内联样式(style="…")。这是一种糟糕的做法
  2. 请确保源文件是用UTF-8编码的。检查您的代码编辑器设置或尝试切换到Sublime Text。为此,请更改设置并再次保存所有文件
  3. 尝试在PHP文件上使用此函数。http://php.net/manual/en/function.mb-internal-encoding.php