评论 php 标签
我从我用来学习 PHP 的教程中得到了下面的代码。我知道 //
用于注释掉代码。在下面代码的第一行中,您可以看到 {// subject selected ?>
php 标签 ?>
是否没有被 // 注释掉
以及选择的主题
文本?
<?php if (!is_null($sel_subject)) {// subject selected ?>
<h2><?php echo $sel_subject['menu_name'];?></h2>
<?php } elseif (!is_null($sel_page)) {// page selected ?>
<h2><?php echo $sel_page['menu_name']; ?></h2>
<?php } else { // nothing selected ?>
<h2>Select a subject or page to edit</h2>
<?php } ?>
I got this code below from a tutorial I'm using to learn PHP. I know that //
is used to comment out code. In the first line of the code below, you see {// subject selected ?>
Is the php tag ?>
not commented out by the //
along with the subject selected
text?
<?php if (!is_null($sel_subject)) {// subject selected ?>
<h2><?php echo $sel_subject['menu_name'];?></h2>
<?php } elseif (!is_null($sel_page)) {// page selected ?>
<h2><?php echo $sel_page['menu_name']; ?></h2>
<?php } else { // nothing selected ?>
<h2>Select a subject or page to edit</h2>
<?php } ?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
解决此类问题的最佳位置是官方手册页:
我可以向您保证,它是比某些爱好者自愿提供的帮助更可靠的知识来源
the BEST place to address such questions is an official man page:
I can assure you that it's way more reliable source of knowledge than some volunteered help from some enthusiast
不,
?>
没有被注释掉。No,
?>
is not commented out.no
?>
不会被行内注释注释掉,而它们是块注释。http://codepad.org/YUhG2DTd
示例:以下
?>
不被注释掉。其中以下内容确实被注释掉了。
no
?>
are not commented out with the in line comment, where as the block comment they are.http://codepad.org/YUhG2DTd
Example: The following
?>
does not get commented out.where as the following does get commented out.
不,
?>
没有注释。因为,这不是 php 语句的一部分。这是 apache 用来确定的标签。 Apache 会将标签包含的内容发送到 php,并将 php 的输出放入其输出缓冲区。No, the
?>
is not commented. Because, that is not part of a php statement. That is a tag that apache uses to determine. Apache will send the contents enclosed by the tags to php and place the output from php in its output buffer.