需要将代码注释放在heredoc中
|
好吧,我似乎无法在
foo.php
文件的heredoc
块内添加注释:
echo <<<_HEREDOC_FOO
// okay this comment was intended to explain the code below but it
// is showing up on the web page HTML sent to the browser
<form action=\"foo.php\" method=\"post\">
<input type=\"submit\" value=\"DELETE RECORD\" /></form>
_HEREDOC_FOO;
表单是否正常工作(顺便说一句,上面的表单代码被高度截断了)
为了我的问题在这里)。
但是当当评论(okay this comment was..blah blah blah
)
也会出现在浏览器中。它显示在
就像上面写的那样:
// okay this comment was intended to explain the code below but it
// is showing up on the web page HTML sent to the browser
我尝试过的注释分界的排列:
// <--
// -->
和....
<-- //
--> //
两种情况均失败,让我在“ 0”内发表评论。
那么,如何在我的0英镑内注释我的代码呢?
没有找到相关结果
已邀请:
4 个回复
呢率篓舍烫
正如其他人提到的那样,您可以进行HTML注释,但是那些查看您的源代码的人仍然可以看到它们
仇聘发栖
爆山
现在是HTML注释
淑灯
只需添加定义
的第一行,您就可以通过这种方式在下一个heredoc中插入注释。如果您不在全局范围内定义函数,这也将起作用。