What are the two ways to use single line comment in php?
Comments in PHPA comment in PHP code is a line that is not executed as a part of the program. Its only purpose is to be read by someone who is looking at the code. Show Comments can be used to:
PHP supports several ways of commenting: ExampleSyntax for single-line comments:
// This is a single-line comment # This is also a single-line comment Try it Yourself » ExampleSyntax for multiple-line comments:
/* Try it Yourself » ExampleUsing comments to leave out parts of the code:
// You can also use comments to leave out parts of a code line Try it Yourself » PHP comments can be used to describe any line of code so that other developer can understand the code easily. It can also be used to hide any code. PHP supports single line and multi line comments. These comments are similar to C/C++ and Perl style (Unix shell style) comments. PHP Single Line CommentsThere are two ways to use single line comments in PHP.
Output: Welcome to PHP single line comments PHP Multi Line CommentsIn PHP, we can comments multiple lines also. To do so, we need to enclose all lines within /* */. Let's see a simple example of PHP multiple line comment. Output: Welcome to PHP multi line comment For Videos Join Our Youtube Channel: Join Now Feedback
Help Others, Please ShareJ. Prettyman ¶ 8 years ago
?>
M Spreij ¶ 17 years ago
magnesium dot oxide dot play+php at gmail dot com ¶ 8 years ago
hcderaad at wanadoo dot nl ¶ 17 years ago
J Lee ¶ 16 years ago
Steve ¶ 17 years ago
'); jballard at natoga dot com ¶ 11 years ago
echo microtime(), " theblazingangel at aol dot com ¶ 15 years ago
Wolfsbay at ya dot ru ¶ 12 years ago
fun at nybbles dot com ¶ 16 years ago
anisgazig at gmail dot com ¶ 2 years ago
The header above will break php mode and return html mode and show 'Standard tag:single line c++ style comment' The header above will break php mode and return html mode and show 'Standard tag:single line unix shell style comment' The header above will break php mode and return html mode and show 'Standard tag:multi line c style comment' The header above will break php mode show a unexpected syntex error' The header above will break php mode show a unexpected syntex error' The header above will break php mode show a unexpected syntex error' The header above will break php mode and return html mode and show 'Short tag:single line c++ style comment' The header above will break php mode and return html mode and show 'Short tag:single line unix shell style comment' The header above will break php mode and return html mode and show 'Short tag:multi line c style comment' The header above will break php mode and return html mode and show 'Script tag:single line c++ style comment' The header above will break php mode and return html mode and show 'Script tag:multi line c style comment' The header above will not break php mode
How comments are used in PHP?A comment in PHP code is a line that is not executed as a part of the program. Its only purpose is to be read by someone who is looking at the code. Comments can be used to: Let others understand your code.
Is a single line comment operator used in PHP?PHP comments can be used to describe any line of code so that other developer can understand the code easily. It can also be used to hide any code. PHP supports single line and multi line comments.
What are the two types of comment tags?What are the two types of comment tags? Single line '//' and multi line comments '/*'.
What is the use of single line comment?Single-line comments allow narrative on only one line at a time. Single-line comments can begin in any column of a given line and end at a new line or carriage return.
|