PHP Comments

Comment is used to hide the code and when you comment the code in PHP, then browser is not able to read this code while executing.

For Example:

<?php

// echo "What are you looking for?";
echo "Try this.";

?>

Example:

<?php

# echo "Or this";
echo "Hey! I'm here.";

?>

Above example is to comment only a single line. You can also use ‘//’ and ‘#’ to comment a single line.

 

To comment more lines, use thisĀ  /* ……… */:

<?php

/*

echo "My name";
$name="Vihaan";
This is used to comment the paragraph or lines more than one.

*/

echo "Got itĀ ?";

?>