[thelist] PHP style question..

Steve Cook steve.cook at evitbe.com
Tue Dec 18 11:20:25 CST 2001


It's much the same as with ASP - there's an overhead to changing between the
parser and HTML code. Having a page with lots of...

This is html <?= $htmlVersion ?> compliant

...dotted about has a slight overhead for each time the parser is called. If
you generate the entire page in PHP with echo or in ASP with Response.Write
you never leave the parser and save some overhead.

Personally I mix and match *somewhat*. Large blocks of HTML I output as part
of the HTML page, but small HTML snippets I always generate in my code.


.steve

------------------------------------------
Steve Cook
web strategist
Evitbe AB
031-15 16 17   031-809 365   0703-13 26 31
steve.cook at evitbe.com       www.evitbe.com
------------------------------------------

> -----Original Message-----
> From: Daniel J. Cody [mailto:djc at members.evolt.org]
> Sent: den 18 december 2001 18:05
> To: thelist at lists.evolt.org
> Subject: [thelist] PHP style question..
> 
> 
> In my journey that leads to PHP godliness, I've been seeing other 
> peoples code that basically echo's out the HTML parts of the PHP page:
> 
> <?
> echo "<html>\n"
> ?>
> 
> Is that commonplace? I find it kind of backwards and usually only put 
> PHP markup *within* HTML, not around it. Am I missing something? Am I 
> coding against the PHP grain? Whats the accepted style(for the most 
> part, i know everyone does their own thing) for most people?
> 
> Thanks! :)
> 
> .djc.
> 

> 




More information about the thelist mailing list