PHP 05: PHP comments
Comments are the part of the PHP code , that is not executed. It’s a note note to the person who is reading the code.
Usage of comments
- Let other programmers / developers understand what is written and what the code does .
- Comments can help you ! It will remind you what you’ve written if you you come back after several days or years.
Types of comments
- Single line commnts
- Block comments
Example of comments
We can use //
or #
for single line comments and /* */
for block comments. Look at the example below.
|
See the output below. Comments have no effect in the output.
Output:
Hello world |
But do not try to nest comments.
|