PHP

Adding Comments to PHP Code

Code that seems clear at the time of writing can seem like a hopeless tangle when you try to amend it six months later. Adding comments to your code as you write can save you time later on and make it easier fo other programmers to work with your code.
A comment is text in a script that is ignored by the PHP engine. Comments can be used to make code more readable or to annotate a script.
Single-line comments begin with two forward slashes (//) or a single hash sign(#). The PHP engine ignores all text between these marks and either the end of the line or the PHP close tag:
// this is a comment
# this is another comment
Multiline comments begin with a forward slash followed by an asterisk (/*) and end with an asterisk followed by a forward slash (*/):
/*
this is a comment
none of this will
be parsed by the
PHP engine
*/

Recommended Tutorials for you


Related posts

How to delete multiple records in PHP

Anuj Kumar

Conditional Statement

Anuj Kumar

Date And Time Formatting With PHP

Anuj Kumar

Time Ago Script

Anuj Kumar

Looping Statement In PHP

Anuj Kumar

Significance and Advantages of PHP Web Development

Anuj Kumar

Captcha Image Verification

Anuj Kumar

Understanding of php.ini

Anuj Kumar

PHP Constants

Anuj Kumar

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.