Which of the following are valid ways to add comments to PHP code?
- // This is a comment
- # This is a comment
- /* This is a comment */
- All of the above
PHP supports different ways to add comments. Single-line comments can be denoted with double slashes (//) or a hash symbol (#) at the beginning of a line. Multi-line comments can be enclosed between /* and */. All of the provided options are valid ways to add comments to PHP code.
Loading...
Related Quiz
- Which of the following are true about the else statement in PHP?
- If a required field is left empty in a PHP form, you can display an error message by ______.
- What is a common use case for Regular Expressions in PHP?
- What is the difference between Exception::getMessage and Exception::getLine?
- The rand() function in PHP returns a ______ integer.