Comments in PHP
Comment
Comments are written in between the codes to remember the purpose of that code.
Comments are not executed with the code. It is written solely for the reader to read and understand why the code was written.
As developers keep working different projects and later when they look back at their old code, it's hard to remember what idea the developer had while writing that peice of code. So to overcome this, we use comments.
Now coming to the types of comments in PHP
We have 2 types of comments :
1.Single line comment
2.Multi-line comment
Single line comments :
Single line comments can be written using the "//".
Example:
Single line comments can also be written using "#".
Example:
Multi-line comments :
In php, Multi-line comments can be written using "/*" and "*/"
Example:
Comments can also be written in between a line of code.
Example: