PHP Comments
A comment is a line that is not executed in output. It is only used to read by the developer for an idea about the code .
PHP supports three ways of commenting:
- We can use ‘//’ for commenting in PHP.
- We can also use ‘#’ for commenting in PHP.
- We can also use ‘/* ... */’ for commenting in PHP.
Syntax -
<?php
//echo " This line is commented"
#echo " This line is commented "
/* echo " This line is commented " */
?>
For example
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h4>hello all of you</h4>
<?php
//echo " welcome to teknowize"
#echo "my name is sumit"
print "i use two different method of commenting in PHP."
?>
</body>
</html>
Output