PHP Comments can be used to hide portion of code line and code description in php programming code. PHP Comments line code can not be executed. Programmer can use PHP Comments to describe code details. PHP Comments can be denoted by // or # for single line and /* */ for multiple line.
PHP Comments Syntax:
// (C++ style single line comment)
OR
# (Unix Shell style single line comment)
OR
/* */ (multiple line comment)
PHP Example :
<?php
// php comments for single line
# Also php comments for single line
/*
php comments for multiple line.
learn php comments tutorials.
Have Great Day Forever!
*/
//$i=100;
echo "Learning PHP Comments Topic.";
?>
Output:
Learning PHP Comments Topic.
Developers can use comments in coding for below purpose.
- Others programmer can understand your code.
- You can remind your project work after long times.
Comments