PHP Comments are line embedded in the code, which is not executed by the server. Commenting on your code is a good habit if you are dealing with some big projects. Commenting helps others to understand your code easily, and it’s also helpful if you are checking your code after a long time.
Think of a situation where many developers are working on the same project, then commenting helps others to understand changes made you.
1- Single-line Comments
2- Multi-lines Comments
Single-line Comments − These kinds of comments are generally used in the short description or relevant notes for the code.
Below are the examples of single-line comments:-
<?php # Here is your first comment //This is your second single-line comment print "Example of single line-comments"; ?>
Multi-lines Comments − They are generally used to provide pseudocode algorithms and more detailed explanations when necessary.
The multiline style of commenting is the same as in C.
Here is an example of multi-line comments.
<?php /* This is an example of multiline comment Name : Jackob Age : 21 City: New York */ print "Example of Multi-lines Comments"; ?>