Home  >  Article  >  Backend Development  >  PHP -- add comments

PHP -- add comments

WBOY
WBOYOriginal
2016-08-08 09:23:241226browse

PHP supports 3 styles of comments

1. C++ style (//) comments

This kind of comment cannot appear in the ?> tag. If the short_open and asp_tag settings are turned on, > and %> cannot appear in the comments either. Medium

<?<span>php
    </span><span>echo</span> 'Hello,PHP!';     <span>//</span><span>我是注释,不被执行    </span>?>

2.C language style, nested comments are not allowed

<?<span>php
    </span><span>/*</span><span>    *我是注释,不被执行
    </span><span>*/</span><span>echo</span> &lsquo;Hello,PHP!<span>&rsquo;;
</span>?>

3.Shell style, the same ban as C++

<?<span>php
    </span><span>echo</span> 'Hello,PHP!';   <span>#</span><span>我是注释,不被执行</span>?>

The above introduces PHP - adding comments, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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