PHP or Hypertext preprocessor is a scripting language that is used widely worldwide. It is especially used in the web development with great ease. It can be embedded into HTML with great ease. It will help to create dynamic and interactive web pages. It is a very efficiently used scripting language. It is a very simple language that can be used by the beginners without any difficulty. It will also provide many advanced features. PHP development is focused on the server side scripting language. This is a language that is used to create content that is used to interact with the databases. Comments are the ones that are necessary for the people to understand what is happening in the particular set of code. Comments are used to describe the functionality of the piece of code. It will help the person who has not written that piece of code to understand better through the use of comments. It can be regarded as the highlighted text. C, C++ and unix style comments are followed in PHP. The comments can be added to the single line or multiple lines in the code. This will be one of the interesting application that will give the detailed information regarding the comments in PHP.
In this lesson we explain how to create comments in php. Basically the comments are not an executable statements. The comments are used just for user reference.
In html the comment starts with <!– and ends with –>
But in php there are two types of comments.
One starts with // for single line.
And another starts with /* and ends with */ .
I will write one example program with comment.
<html> <head> <title>Welcome</title> </head> <body> <?php //This program written by Freelance developers... echo "This is my comment statement programs.."; /* This is the end of the php program */ ?> </body> </html>
Video demonstration: