better to open/close PHP or echo HTML?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mechphisto@gmail.com

    #1

    better to open/close PHP or echo HTML?

    We're having this little debate here in the shop about which method is
    more efficient on the parser, server, whatever. Staying in one parse
    "session" and echoing HTML output or entering and leaving PHP and
    leaving HTML to be presented "naturally" :

    (a)
    <?php
    [stuff]
    echo "<html><body>st uff $var stuff";
    [stuff]
    echo "stuff $var2 stuff </body></html>";
    ?>

    (b)
    <?php
    [stuff]
    ?>
    <html><body>stu ff <?= $var ?stuff
    <?php
    [stuff]
    ?>
    stuff <?= $var2 ?stuff</body</html>

    any feedback?
    Thanks!!
    -Liam

Working...