A Web Design Community curated by Chris Coyier

A little dab'll do ya

Code Snippets

Home » Code Snippets » PHP » Comments in PHP Submit one!

Comments in PHP

<?php

    /*
           This code by Chris Coyier
    */

    $i = 0;    // counter to be used later;

?>

Comments in PHP can be between /* */ markings (useful for multiple line comments) or after // markings (for single lines only).

Subscribe to The Thread

  1. Miguel says:

    Have you tried the other type of comments? you use the # sign and they work like // comments.


    # like this

  2. Brad says:

    Can you help me with a small text based counter script ? It says something like permission error.

It's Your Turn

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
--- The Management ---