How to write comments in PHP ?

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 zambiatek"
echo "Hello zambiatek";
  
?>


Output:

Hello zambiatek

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

PHP




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


Output:

Hello Geeks

Supported Browsers are listed below:

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

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button