Forums

[resolved] How to hide notes in PHP? (7 posts)

  1. dakranii
    Member
    Posted 2 years ago #

    This should be pretty easy. In HTML you can leave yourself notes in the code with

    <!-- notes -->

    What is the PHP equivalent? I feel like I've seen // or /* but I'm not sure what works or how to end it exactly. And search-engine searches for // or <!-- or /* aren't giving me answers.

    Thank you!

  2. whooami
    Member
    Posted 2 years ago #

  3. s_ha_dum (was apljdi)
    Member
    Posted 2 years ago #

    // comments out to the end of the line
    /* starts a multiline comment
    */ ends a multiline comment

    Searching for anything besides alphanumeric characters is frustrating, but searching for 'PHP comment' will get you exactly what you want.

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    /* Comment */

    Is the same method used in CSS.

    I generally use the single line approach myself..

    // Comment

    You know, you could of opened any number of WordPress files to find this out, the config file would have been an easy one (wp-config.php).

  5. dakranii
    Member
    Posted 2 years ago #

    t31os_, right, I suppose I could have just opened a file and looked.

    But I got nice commentary on the differences between them from apljdi (single line vs. mutli-line) and some good links from whooami that will make my eyes bleed from reading. :-)

    Thank you everyone for the quick and helpful replies.

  6. Mark / t31os
    Moderator
    Posted 2 years ago #

    As long as everyone's happy.. :)

  7. rsciw
    Member
    Posted 2 years ago #

    just to add for completion, there's also

    #comment
    which is equivalent to
    //comment
    in php

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.