PHP Comment

1 - Single line comment

2 - Multiline comment

Why Use Comment

Comment are used to stop the execution of code 

Write comment to help for new developer

Single line comment


// $string = "Hello boss  how are you";

$str = " Hello how are you";

echo $str;

#This is also single line comment


Multi-line comment


$string = "Hello  PHP ";

/* **This is multi-line comment

and $string is a variable


echo $string;


Use comment in function


$string =  "php is server side language";

function myFunction(){

// echo $string;  it geenerate an error

echo "php run on server ";





php run on server