C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
PHP CommentsPHP comments can be used to describe any line of code so that other developer can understand the code easily. It can also be used to hide any code. PHP supports single line and multi line comments. These comments are similar to C/C++ and Perl style (Unix shell style) comments. PHP Single Line CommentsThere are two ways to use single line comments in PHP.
<?php // this is C++ style single line comment # this is Unix Shell style single line comment echo "Welcome to PHP single line comments"; ?> Output:
Welcome to PHP single line comments
PHP Multi Line CommentsIn PHP, we can comments multiple lines also. To do so, we need to enclose all lines within /* */. Let's see a simple example of PHP multiple line comment. <?php /* Anything placed within comment will not be displayed on the browser; */ echo "Welcome to PHP multi line comment"; ?> Output:
Welcome to PHP multi line comment
Next TopicPHP If Else
|