2014-09-07

Comments in PHP

In PHP, we use // to make a single-line comment or /* and */ to make a large comment block.

Example of single line Comment

<html>
<body>
<?php
//This is a comment
?>
</body>
</html>


Multi - line Comment

Example of Multi - line Comment

<html>
<body>
<?php
/*
This is a comment block
*/
?>
</body>
</html>


Advantages of Comment

Comments are not displayed by the browser, but most of the Designer and Developer using this Comment(single-line or multi-line comment) for Future Implementation.
With comments you can place message, code, notifications and reminders in your PHP Document. Comments are also great for debugging PHP or in any Language, because you can comment out PHP lines of code, at a time, to search for errors.

0 comments:

Post a Comment

Tools & Plugins

Blog Archive