You are here: Re: better to open/close PHP or echo HTML? « PHP Programming Language « IT news, forums, messages
Re: better to open/close PHP or echo HTML?

Posted by Tom on 03/08/07 18:21

On 8 Mar 2007 09:32:39 -0800, mechphisto@gmail.com wrote...
>
>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>stuff $var stuff";
>[stuff]
>echo "stuff $var2 stuff </body></html>";
>?>
>
>(b)
><?php
>[stuff]
>?>
><html><body>stuff <?= $var ?> stuff
><?php
>[stuff]
>?>
>stuff <?= $var2 ?> stuff</body</html>
>
>any feedback?
>Thanks!!
>-Liam
>

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.

Tom
--
Newsguy.com
75+ Days Retention!
Higher levels of article completion!
Broader newsgroups coverage

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация