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

WBOY
Release: 2016-06-06 20:43:51
Original
1080 people have browsed it

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

html代码
<?php ?>
</code>
Copy after login
Copy after login

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

回复内容:

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

html代码
<?php ?>
</code>
Copy after login
Copy after login

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

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

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!