Home > Backend Development > PHP Tutorial > 单行注释://,解决方法

单行注释://,解决方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:48:21
Original
1263 people have browsed it

单行注释://,#?
基本语法-》注释

单行注释仅仅注释到行末或者当前的 PHP 代码块,视乎哪个首先出现。这意味着在 // ... ?> 或者 # ... ?> 之后的 HTML 代码将被显示出来:?> 跳出了 PHP 模式并返回了 HTML 模式,// 或 # 并不能影响到这一点。如果启用了 asp_tags 配置选项,其行为和 // %> 或 # %> 相同。不过, 标记在单行注释中不会跳出 PHP 模式。 

“ 标记在单行注释中不会跳出 PHP 模式。”,这句话是什么意思?
给个实例。
------解决方案--------------------
可能是译者的表述能力有限吧,原文被翻译的隐晦难懂

其实他表述的是: 
单行注释符“//”、“#” 不能注释掉 php 代码块结束符 ?>
但可以注释掉块结束符 

<script language=php>//</script><br />echo 'aaa';<br />
Copy after login
aaa
<script language=php>//<br /></script><br />echo 'aaa';<br />
Copy after login
echo 'aaa';

Related labels:
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