better to open/close PHP or echo HTML?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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":

echo "<html><body>stuff $var stuff";
echo "stuff $var2 stuff </body></html>";

<html><body>stuff <?= $var ?> stuff
stuff <?= $var2 ?> stuff</body</html>

any feedback?

Re: better to open/close PHP or echo HTML?

On 8 Mar 2007 09:32:39 -0800, wrote...
Quoted text here. Click to load it

I'd probably look at it more as a style and a way to organize than a performance
issue. If you have lots of PHP variables in your HTML then that likely has
greater affect as the number of variable increases using either method, but
would probably need a significant level to notice the difference. Would be an
interesting test to see how much of a difference there is.

75+ Days Retention!  
Higher levels of article completion!  
Broader newsgroups coverage

Site Timeline