• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

html内嵌php出现乱码,最简单的php程序也通不过,该怎么解决

php 搞代码 3年前 (2022-01-24) 14次浏览 已收录 0个评论

html内嵌php出现乱码,最简单的php程序也通不过

PHP code

<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->  <title>connect.php</title><body>    <strong>This is true.</strong>">ÕâÊǸö³¬Á´½Ó<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;?>

我这里要是单单

PHP code

<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php     $a=8;    $b=4;    if($a>$b){            $a++;        }        $c=$a+$b;        echo "a+b=".$c;?>

是能显示出来的
或者

PHP code

<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->    <strong>This is true.</strong>">超级连接

也能显示出来,
但是下面放了

PHP code

<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><table>            <tr>                <td>rrrrrr</td>                <td>hhhhhh</td>            </tr></table>

就出现乱码了。。。为什么会这样?

——解决方案——————–
应该不可能。除非你输入时就已经乱码了。
——解决方案——————–
看看你的文件编码
——解决方案——————–
1.文件自身编码

2.html编码

<meta http-equiv=”Content-Type” content=”tex本¥文来源gaodai$ma#com搞$代*码*网(搞代gaodaima码t/html; charset=utf-8″/>

——解决方案——————–

PHP code

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  connect.php<body>    This is true.">超级链接

rrrrrr hhhhhh

<?php $a=8; $b=4; if($a>$b){ $a++; } $c=$a+$b; echo "a+b=".$c;?>


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:html内嵌php出现乱码,最简单的php程序也通不过,该怎么解决

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址