>  기사  >  백엔드 개발  >  html内嵌php出现乱码,最简单的php程序也通不过,该怎么解决

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

WBOY
WBOY원래의
2016-06-13 13:47:36935검색

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

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->

  <title>connect.php</title>



    <strong>This is true.</strong>
<a href="<?php%20echo%20www.baidu.com;%20?>">ÕâÊǸö³¬Á´½Ó</a>
rrrrrr hhhhhh
$b){ $a++; } $c=$a+$b; echo "a+b=".$c; ?>

我这里要是单单
PHP code
<!--

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
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->    <strong>This is true.</strong>
<a href="<?php%20echo%20www.baidu.com;%20?>">超级连接</a>
也能显示出来,
但是下面放了
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
rrrrrr hhhhhh

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

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

2.html编码





------解决方案--------------------
PHP code



<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>connect.php</title>



    <strong>This is true.</strong>
<a href="<?php%20echo%20www.baidu.com;%20?>">超级链接</a>
rrrrrr hhhhhh
$b){ $a++; } $c=$a+$b; echo "a+b=".$c; ?>
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.