phpicoder Nov 1, 2021 php

Hi guys, in this tutorial we will learn PHP Comment.

PHP comment is a very important part of the project. Comments in PHP are similar to comments that are used in php file 
comment's main purpose of different developer read comment and know how to use this code for this functions 
PHP supports two types of comments
single line comment
Multiple lines comment

single line comment:

PHP single line comment is used to make a comment for just single line of code. It starts with pound `//` or `#` icon. The rest of text after the sign is ignored code

Now following examples of using single line PHP comment:

<?php
	// This is a single line c++ style comment
    echo 'Hello World'; 

    #full name
    echo 'johan do';
?>

Multiple lines comment:

PHP Multiple lines is a C language  style comment. It starts with /* and ends with */. Whenever the comment needs to span on more lines, you use multiple lines comment.

Now following examples of using multiple line PHP comment:

<?php
	/* The following multiple line examples
		for sum of two varable  */

	$a = 10;
	$b = 20;
	$sum = $a + $b;
?>
I hope this tutorial help for you.