PHP Comments are used to describe any line of code or program, But it can also be used to hide your code. Code hiding means, the code will not be executed.
Not only this, it will also help other developers to understand your code easily. And it also helps you because sometimes you forget why you wrote this code.
Like other languages, PHP also supports single-line comments and multiple line comments.
Comments are not executed. That means you can’t see comments in browsers.
There are two types of comments –
In PHP, there are two ways to add single-line comments –
<?php //This is a single line comment #This is another single line comment echo "You can't see comments in browsers"; ?>
In PHP, Multiple Line Comments start with
/* and ends with
<?php /* Multiple Line Comments */ echo "Hello World!"; ?>