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. Learn more: https://www.php.net/manual/en/language.basic-syntax.comments.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *