How To Write Comments In PHP Example?

PHP 8 , PHP

Nicesnippets

07-12-2021


How To Write Comments In PHP Example?

Hi Friends,

This example is How to write comments in PHP?

In this article, we have to pass a comment for PHP code by using simple basic syntax.

Comments are helpful to understand the complex short code.

The comment tag is useful during the debugging of the codes php.

We use comments to understand the functionality of the code.

So let's start example following step.

Example : 1


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

<?php

// Output "Hello Nicesnippets"

echo "Hello Nicesnippets";

?>

Output:

Hello Nicesnippets

Example : 2

Multiline comments begin with /* and ends with */.

<?php

echo "Hello Nicesnippets";

/* It will print the

message "Hello Friends" */

?>

Output:

Hello Nicesnippets

Supported Browsers are listed below:

1. Google Chrome

2. Internet Explorer

3. Firefox

4. Safari

5. Opera

I hope it can help you.....