The Wayback Machine - https://web.archive.org/web/20240619192111/https://www.geeksforgeeks.org/how-to-write-comments-in-php/
Open In App

How to write comments in PHP ?

Last Updated : 05 Jan, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we have to pass a comment for PHP code by using some simple basic syntax. Comments are helpful to understand the complex code. The comment tag is useful during the debugging of the codes. We use comments to understand the functionality of the code. 

Basically, the single-line comments begin with // comments.   

Example 1:  

PHP




<?php
  
// Output "Hello GeeksforGeeks"
echo "Hello GeeksforGeeks";
  
?>


Output:

Hello GeeksforGeeks

Example 2: Multiline comments begin with /* and ends with */.

PHP




<?php
  
echo "Hello Geeks"; 
/* It will print the 
   message   "Hello geeks" */
  
?>


Output:

Hello Geeks

Supported Browsers are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

Previous Article
Next Article

Similar Reads

How to write comments in HTML ?
In this article, we have to pass a comment for an HTML by using &lt;!-- Comment --&gt; tag. In html, we can add single-line comments and multi-line comments. These are used to insert comments in the HTML code. It is helpful to understand complex code. The comment tag is useful during the debugging of the codes. Syntax: Single line comment &lt;!-- C
1 min read
How to write comments in ReactJS ?
To write comments in React JS we use the javascript comments and JSX object. It helps in adding useful information about the code and comment-out and ignore the extra code in the program. Writing comments in React is done in these ways. Table of Content Using JavaScript commentsUsing JSX objectSteps to create React ApplicationStep 1: Create a React
3 min read
How to auto like all the comments on a facebook post using JavaScript ?
In this article, we are going to learn how to like all the comments on a Facebook post automatically. Many times we want to like all the comments of friends on our post or on any other's post, so this script helps us to save time and effort by automatically liking all the comments on the post. Approach: Make variable comments that points to an arra
2 min read
SASS | Comments
Comments in SASS is very similar to the comments in any other programming language. But the difference comes when we talk about the type of comments will be there in the compiled CSS file. There are two types of comments in Sass: Silent Comments: Silent comments are single-line comments. When we compile Sass file these comments don't reflect in com
1 min read
How to block comments in YAML ?
YAML is a human-friendly data serialization standard for all programming languages. It is commonly used for configuration files and in applications where data is being stored or transmitted. The Normal Way for commenting in YAML is Inline commenting with the "#" symbol, however, if you want to comment blocks then we have a list of ways in which it
2 min read
YAML Comments
Comments are used to prevent the execution of statements. Comments are ignored while the compiler executes the code. Comments are user-friendly as user can get explanations of code using comments. Since you are alright with the sentence structure and fundamentals of YAML, let us continue further into its details. In this part, we will perceive how
3 min read
Integrating Facebook Comments Plugin in Django Project
Django is a Python-based web framework that allows you to quickly create efficient web applications. It is also called batteries included framework because Django provides built-in features for everything including Django Admin Interface, default database – SQLlite3, etc. In this article, we will learn to integrate the Facebook comment plugin in Dj
2 min read
Documentation Comments in JSDoc
In JSDoc we need to include documentation comments in the code through which JSDoc will generate an HTML documentation website. Let's see how to create documentation comments for different types of code. String, Numbers &amp; Arrays: C/C++ Code /** * Site Name * @type {string} */ const siteName = &quot;GeeksForGeeks&quot;; /** * Number * @type {num
4 min read
WordPress Delete Comments
WordPress is a tool and an open-source Content Management System that is totally based on PHP and MySql which is used to create a dynamic website. WordPress was written in PHP language by Matt Mullenweg. It is one of the most popular interfaces that allow users to customize and manage the website from its back-end content management system. To orga
2 min read
WordPress Moderate Comments
WordPress is a tool and an open-source Content Management System that is totally based on PHP and MySql which is used to create a dynamic website. WordPress was written in PHP language by Matt Mullenweg. It is one of the most popular interfaces that allow users to customize and manage the website from its back-end content management system. To orga
3 min read