Php comment

php es text / code lines dks use it to comment, it is not displayed to the user in the web page, the web developer gives the comment for themselves in the source code, in this the description of the code (Explanations) can be given which read the source code. This helps in understanding and therefore developers use the comment.

1 php Single line comment

Symbol of double forward slash (//) is applied next to the text / code lines to be commented in php or use the # symbol.

Syntax

1 // - - - -

2 # - - - -

Example 1

<?php

// single line comment example

# single line comment example

echo " single line comment example ";

?>

Output

single line comment example

2 Multiple line comment

Symbol of asterisk (*) and forward slash (/) is placed at the end of forward slash (/) and asterisk (*) and text / code lines to comment two or more text / code lines in php.

Syntax

1 /* …..*/

Example 2

<?php

/*

PHP multiple line comment example

PHP multiple line comment example

;

*/

echo " PHP multiple line comment example ";

?>

Output

PHP multiple line comment example


Connect with us

facebook logo
Email : contact@amcodestar.com
© Copyright amcodestar.com 2020 - 2023 All Rights Reserved.
About us     term and condition      comment policy
DMCA.com Protection Status