Forums

Make PHP "go away" (7 posts)

  1. Lorelle
    Member
    Posted 7 years ago #

    As I'm working on testing different plugins and tags, there are times when I want the php tag or code line to "go away" when I generate the test page. I don't want to delete it, I just want to comment it out. I've tried <!-- <?php thecode(true, false, true); ?> --> but that isn't working.

    How do you hide PHP tags within a template file so they don't "work" but not delete them?

  2. TechGnome
    Moderator
    Posted 7 years ago #

    //

    the < ! -- tag is an HTML comment.... to comment out PHP code, add // to the front of the PHP line.

    <!-- <?php //thecode(true, false, true); ?> -->
    OR to do an entire block /* */

    <!-- <?php /*thecode(true, false, true); */ ?> -->

    Tg

  3. idbehold
    Member
    Posted 7 years ago #

    or
    <!-- ?php thecode(true, false, true); ? -->

  4. TechGnome
    Moderator
    Posted 7 years ago #

    Except that way, if you View Source, you would actualy see the PHP code, which maybe undesireable.

    Tg

  5. Kafkaesqui
    Moderator
    Posted 7 years ago #

    You can leave off the html comment tags from TG's post:

    <?php // thecode(true, false, true); ?>

    or

    <?php /* thecode(true, false, true); */ ?>

  6. jonimueller
    Member
    Posted 7 years ago #


  7. Lorelle
    Member
    Posted 7 years ago #

    Joni, that works great for CSS, but for testing plugins and different tags, hiding the PHP is critical.

    Thanks to everyone. This will really help!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.