Comments in PHP:

A comment is nothing but a portion of a programme which you can write in your php coding but it will not executed by server and not display on browser. The main purpose of comment is that it will help the person who is editing that code.

So you can also say that comments are used to make notes about the code for future help when you or someone other is going to use that code.

In PHP you have two types of comments that are as follows:

  • Single Line Comment
  • Multi Line Comment

Single Line Comment:

A single line comment is use to comment only one line at a time. You can comment a single line in two different ways.

 Example:

Multi Line Comment:

As the name of it multi line so it will use when you want to comment more that one line. So you can provide more explanation by using multi-line comment.

Example:

 

One response to “Comments in PHP”

  1. Loy Bitt says:

    I enjoy the efforts you have put in this, thanks for all the great posts.

Leave a Reply

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