WordPress.org

Support

Support » How-To and Troubleshooting » PHP programming tip

PHP programming tip

  • 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.

  • The topic ‘PHP programming tip’ is closed to new replies.
Skip to toolbar