Commenting Code in PHP

Commenting your code is a good habit to have. Entering comments in HTML documents helps you (and others who might have to edit your document later) keep track of what’s going on in large documents. Comments also allow you to write notes to yourself during the development process or comment out parts of code when you are testing your scripts, so the code is not executed.
HTML comments are ignored by the browser and are contained within <!– and –> tags. For example, the following comment reminds you that the next bit of HTML code contains a logo graphic:

<!– logo graphic goes here –>

PHP uses comments, too, which are ignored by the PHP parser. PHP comments are usually preceded by double slashes, like this:

// this is a comment in PHP code

But you can use other types of comments, such as
# This is shell-style style comment

and
/* This begins a C-style comment that runs onto two lines */

About the author

Being the CEO and Founder of ClecoTech International, Mr. Ashish Prajapati is dedicated towards his aim of mentoring young startups into a full-fledged businesses. He is helping startups from America, Europe, India, and various other countries through proper guidance and the use of latest technologies to develop their innovation and ideas into definite realities.

Leave a Reply

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