Comments are notes about the code, they explain the function performed by a specific code.
Comments are extremely important for you and for other people who will use your code. It is a good idea to get used to comment your code as soon as possible. When you will be working on someone else’s code, or even your own code after a long time, comments will save your life.
Browsers and servers will ignore comments. In PHP you can use double shash (//) or hash mark (#) syntax for single line comments, slash asterisk (/* … */) syntax for multiline comments.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php //this is a single line comment (C++ style) #this is another way to write a single line comment (Unix shell style) /* THIS IS A MULTILINE COMMENT (C style) */ ?> |
Click here to read about how to output data in PHP.