PHP Single line and multiline Comments

By comment it means that the developers do not want to execute that particular code.

It is generally to test that this particular code is running properly or not.

Single line comment:  //

Multiline comment: /* .....
                         ...  */


PHP stand for

Explanation: If one want to comment a single line then they can use either – “//” or “#” or if one want to comment multiple line then they can use- “/* —code—-*/”

And in the last part you must have seen that particular section has been commented so that part would not be seen by anyone and result would be that part that is not commented.

Write a PHP program to add two numbers. Use appropriate comment when required.

addition program in php is very simple.

  1. Take two variables and give them initial value
  2. Add both variables and store in another variable
  3. print the sum

Above program shows addition in PHP