首页 > php > 如何在Notepad ++中正确使用语言格式

如何在Notepad ++中正确使用语言格式 (How to properly use language format in Notepad ++)

2018-07-22 phpnotepad++

问题

我有这种情况试图禁用序列到.php文件(黑色注释行,返回顶部文本按钮); 我已经阅读了关于notepad ++中的块注释并设置了文件的语言,但它看起来的注释没有正确实现。

在此输入图像描述

我做了什么:
-File /打开.php文件,
(看起来好像用php语言查看颜色)
- 355-359行和Block Comment(ctrl + shift + Q)之间的选择。那个,我添加了文本,但它看起来不像其他现有的评论。

有什么想法吗?谢谢,

解决方法

PHP注释仅在PHP模式(在<?php和之间?>)时才有效。

输出HTML时,需要HTML注释才能获取表单<!-- comment which does not include two adjacent hyphens -->

HTML注释中的PHP仍将执行,结果将输出到浏览器。看起来你的PHP只输出数据并且没有做任何重要的处理,所以这可能就足够了。您可能,尤其是在其他情况下,最好只删除代码,然后稍后从版本控制系统的历史记录中恢复它。

问题

I have this situation trying to disable a sequence into a .php file (the black commented lines, back-to-top text button); I've read about block commenting in notepad ++ and setting the language of the file but the comment it looks like is not implemented properly.

enter image description here

What I've done :
-File / Open the .php file,
(already it looks like it is viewed in php language judging by the colors)
-Selection between 355-359 lines and Block Comment (ctrl+shift+Q).After that, I've added the text but it doesn't look like the other existing comments.

Any thoughts? Thanks,

解决方法

PHP comments only work when you are inside PHP mode (between <?php and ?>).

When you are outputting HTML, you need HTML comments which take the form <!-- comment which does not include two adjacent hyphens -->.

The PHP within an HTML comment will still execute and the results will be output to the browser. It looks like your PHP only outputs data and doesn't do any significant processing, so that will probably be sufficient. You might, especially in other cases, be better off simply deleting the code and then restoring it from your version control system's history later.

相似信息