Home  >  Article  >  Backend Development  >  php echo语句为何有时会在新页面才回显,有时候在原页面回显。

php echo语句为何有时会在新页面才回显,有时候在原页面回显。

WBOY
WBOYOriginal
2016-06-06 20:43:511072browse

<code><?php //php代码 
    echo"some string";
?>

html代码
<?php ?>
</code>

这种情况下,echo语句就会在新页面回显。
但如果把
php语句合在一起,在之后放上html语句,
echo语句就会在html代码前回显,这是为什么?
麻烦各位了!

回复内容:

<code><?php //php代码 
    echo"some string";
?>

html代码
<?php ?>
</code>

这种情况下,echo语句就会在新页面回显。
但如果把
php语句合在一起,在之后放上html语句,
echo语句就会在html代码前回显,这是为什么?
麻烦各位了!

浏览器只能执行html代码,不能执行php代码。php代码是在服务器执行完,生成html内容,返回给浏览器,浏览器才能显示出来。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn