Menu

Add Topic

programming

waiting answer July 28, 2021

How to write comments in PHP

Answers
June 13, 2021

Comments will help you and other developers to understand what you were trying to do with the PHP code. Comments are ignored by the PHP Engine and are not displayed in Output.

There are two types of comments in PHP

  1. Single-Line Comments
  2. Multi-line Comments

Single-Line Comments

Single line comments in PHP begins with //, Let's check the following example

    <?php
        echo "Welcome to America"; // This is a comment
    ?>

Multi-line comments

Multiline comments begin with /* and end with */

     <?php
        /*
        @author: Developer Name
        Purpose: Simple Display echo statement
        */
        echo "Welcome to America"; // This is a comment
    ?>
0 0

Please Login to Post the answer

Leave an Answer