Language Comments

One of the most important parts in any programming language is comments. Is a very good practice to comment every part of the code (variables, functions, classes, etc).

PHP has several types of comments:

Single line comment:

//Comment goes here

Single line comment (another option):

#Comment goes here

Multi line comment:

/*
Comment goes here
*/

API Documentation:

/**
* Function Description
*
* @param string $my_var
*/

function my_function($my_var) {
   "code goes here"
}

0
Your rating: None

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><p>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: [code], [blockcode], [as], [as3], [css], [drupal5], [drupal6], [html], [java], [javascript], [mysql], [php], [xml].
  • You may quote other posts using [quote] tags.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.