For any queries you can reach us at infovistarindia@gmail.com / WhatsApp us: +919158876092

PHP Comments

PHP Comments

A comment is non-executable lines. It is used to write a description for a better understanding. The web browser doesn't read the comments.

  • Single line comments
  • Multi-lines comments

Single line comments:

There are two ways to use single-line comments in PHP.

// (C++ style single line comment)

# (Unix Shell-style single line comment)

<?php
echo “Welcome to PHP language”;
// (C++ style single line comment)
# (Unix Shell-style single line comment)
?>

Multi-lines comments

Multi-lines comments are used to comment on multiple lines. For multi-line comments, we need to enclose all lines within /* ... */.

<?php 
/* 
	This is a comment with multi-line comment 
	Developer: infovistar.com 
*/
echo “Welcome to PHP language”; 
?>