Which of the following can be used as comments 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 » J. 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
'); theblazingangel at aol dot com ¶ 15 years ago
jballard at natoga dot com ¶ 11 years ago
echo microtime(), " 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
What is used for comments in PHP?Single-line PHP Comments
To leave a single-line comment, type two forward slashes (//) followed by your comment text. All text to the right of the // will be ignored. You can also use a hash symbol (#) instead of // to make a single-line comment.
Which of the following is correct to add a comment in PHP?Which of the following is the correct way to add a comment in PHP code? Explanation: In PHP, /* */ can also be used to comment just a single line although it is used for paragraphs. // and # are used only for single-line comments.
Which of the following is a single line comment of PHP?PHP Comment Syntax: Single Line Comment
To do a single line comment type "//" or "#" and all text to the right will be ignored by PHP interpreter.
Can you comment through multiple lines in PHP?In 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.
|