Software Development Exam  >  Software Development Videos  >  PHP for beginners  >  PHP Tutorial 6 - Comments (PHP For Beginners)

PHP Tutorial 6 - Comments (PHP For Beginners) Video Lecture | PHP for beginners - Software Development

30 videos

Top Courses for Software Development

FAQs on PHP Tutorial 6 - Comments (PHP For Beginners) Video Lecture - PHP for beginners - Software Development

1. What is the purpose of comments in PHP?
Ans. Comments in PHP are used to add explanatory text within the code, which is ignored by the PHP interpreter. They are helpful for developers to document their code, make it more readable, and add notes or reminders for themselves or other programmers.
2. How to write a single-line comment in PHP?
Ans. To write a single-line comment in PHP, you can use the double forward slash (//) followed by the comment text. Anything after the double slash on the same line will be treated as a comment and will not be executed by the PHP interpreter.
3. What is the syntax for writing a multi-line comment in PHP?
Ans. To write a multi-line comment in PHP, you can enclose the comment text between /* and */. Everything between these symbols will be treated as a comment and will not be executed by the PHP interpreter. This allows you to comment out multiple lines of code at once.
4. Can comments be nested in PHP?
Ans. No, comments cannot be nested in PHP. This means that you cannot start a comment inside another comment. If you try to do so, it will result in a syntax error. However, you can use multiple single-line or multi-line comments consecutively to achieve a similar effect.
5. Are comments visible in the final output of a PHP program?
Ans. No, comments are not visible in the final output of a PHP program. They are purely for documentation and readability purposes and have no impact on the actual execution of the code. The PHP interpreter ignores comments completely, and they are not displayed in the browser or any other output medium.
30 videos
Explore Courses for Software Development exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

pdf

,

Sample Paper

,

practice quizzes

,

MCQs

,

Important questions

,

Summary

,

past year papers

,

Free

,

mock tests for examination

,

Previous Year Questions with Solutions

,

video lectures

,

PHP Tutorial 6 - Comments (PHP For Beginners) Video Lecture | PHP for beginners - Software Development

,

Extra Questions

,

Viva Questions

,

ppt

,

study material

,

PHP Tutorial 6 - Comments (PHP For Beginners) Video Lecture | PHP for beginners - Software Development

,

PHP Tutorial 6 - Comments (PHP For Beginners) Video Lecture | PHP for beginners - Software Development

,

Objective type Questions

,

shortcuts and tricks

,

Semester Notes

,

Exam

;