WordPress.org

Ready to get started?Download WordPress

Forums

PHP programming tip (1 post)

  1. Eeve
    Member
    Posted 8 years ago #

    You don't need to put the open and close php tags on every line of php. Only around a block of php (between blocks of html). Like this:

    <?php
    if( $success ){
    $success = !$success;
    }else{
    $myvariable += 1;
    }
    ?>

    here is some html.

    <?php
    // More php code
    // goes here.
    ?>

    This will make your php code easier to read and more efficient.

Topic Closed

This topic has been closed to new replies.

About this Topic