Basic
Advanced
Examples
PHP 8 - Comment
Last modified: April 02, 2022-
Comments are ignored and will not be executed
-
It's only purpose to read notes by a a person to know more about the code
-
There are three main ways of commentting PHP code
-
If PHP code is updated/modified, you must update the comments otherwise it will create confusion
-
1 //
<!DOCTYPE html>
<html>
<body>
<?php
// This is a single-line comment
?>
</body>
</html>
-
2 #
<!DOCTYPE html>
<html>
<body>
<?php
# This is also a single-line comment
?>
</body>
</html>
-
3. /* */
<!DOCTYPE html>
<html>
<body>
<?php
/*
This is a multiple-lines comment block
*/
?>
</body>
</html>