<html>
<head>
  <title>connect.php</title>
</head>
<body> <strong>This is true.</strong>
<a href="<?php echo www.baidu.com; ?>">ÕâÊǸö³¬Á´½Ó</a>
<table>
<tr>
<td>rrrrrr</td>
<td>hhhhhh</td>
</tr>
</table>
<?php 
$a=8;
$b=4;
if($a>$b){
$a++;
}
$c=$a+$b;
echo "a+b=".$c;
?>
</body>
</html>
我这里要是单单
<?php 
$a=8;
$b=4;
if($a>$b){
$a++;
}
$c=$a+$b;
echo "a+b=".$c;
?>
是能显示出来的
或者
<strong>This is true.</strong>
<a href="<?php echo www.baidu.com; ?>">超级连接</a>也能显示出来,
但是下面放了
<table>
<tr>
<td>rrrrrr</td>
<td>hhhhhh</td>
</tr>
</table>
就出现乱码了为什么会这样?

解决方案 »

  1.   

    1.文件自身编码2.html编码
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      

  2.   


    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <title>connect.php</title>
    </head>
    <body>    <strong>This is true.</strong>
    <a href="<?php echo www.baidu.com; ?>">超级链接</a>
    <table>
                <tr>
                    <td>rrrrrr</td>
                    <td>hhhhhh</td>
                </tr>
    </table>
    <?php 
        $a=8;
        $b=4;
        if($a>$b){
                $a++;
            }
            $c=$a+$b;
            echo "a+b=".$c;
    ?>
    </body>
    </html>
    LZ自己检查下编码,都改为UTF-8