How to put comments in php
Posted by chaabant on Dec 26, 2007
In php there are different ways to put comments , comments are very important .
Importance of php Comments in programming:
- It’s a Good Practice
- It saves a lot of time , you won’t need to read your code to understand what it does
- Make your code understandable for others, so that if many programmers are working on a same project, or when your boss fires you, it would be helpful for then next programmer to understand what you have done.
Any code that took thought to write will take thought to reread after several days, months or in some cases, years.
Ok , now let’s go back to How to put comments in php …
-
// Single line comment
-
-
-
# Single line comment
-
-
-
-
/* Multi-line
-
Line 1
-
Line 2
-
Line 3
-
*/
-
-
-
-
/**
-
* API Documentation Example
-
*
-
* @param string $bar
-
*/
-
-
function foo($bar) { } //code