A comment is only a piece of information that does not execute but merely gives the reader of the code some information. Comments make the code easier to understand. PHP allows for both single-line and multiple-line comments.
Writing comments alongside your code is usually advised since they are very helpful. You may learn from the comments what a specific piece of code is meant to do. For every programmer who reads or works on it, comments serve as notes.
To add a single-line comment, insert two forward slashes like this (//); anything on the same line following these two slashes will be ignored and not executed.
PHP also supports single-line comments using the number symbol (#).
Comments that span several lines always start with (/*) and close with (*/). They may go on for as many lines as you need.
A portion of code may also be commented out to prevent execution. You may use this approach to identify the areas of code that contain errors.