Sunday, 28 April 2024

Adding Comments to PHP Code

 



What is comment?

A comment is a text in a script that is ignored by the PHP engine. Comments can be used to make the code more readable or to annotate a script.

Single Line Comment

Single-line comments begin with two forward slashes (//) or
a single hash sign(#).
The PHP engine ignores all text between these marks and either the end of the line or the PHP close tag:
// this is a comment
# this is another comment

Multiple Line Comment

Multiline comments begin with a forward slash followed by an asterisk (/*) and end with an asterisk followed by a forward slash (*/):
/*
this is a comment none of this will be parsed by the PHP engine
*/

0 comments:

Post a Comment