[thelist] PHP inside or outside?

Tony Crockford tonyc at boldfish.co.uk
Sat Apr 24 07:00:23 CDT 2004


At 12:16 on Saturday, 24 Apr 2004, Joao Verde wrote:

> Anyway, I recently had to work on another person's HTML including my own  
> pieces of code where needed and that made me wonder: what is quicker for  
> the parser? Having one single block of PHP code with HTML being echoed  
> (echo with single quotes) or, by contrast, having all HTML with pieces  
> of PHP code where needed?
>
> Should the difference be irrelevant, what, to you, seems to be the best  
> practice?

My understanding is that it's quicker to drop in and out of PHP for html  
code.

I also find it easier to read  echo'd php variables within html than to  
read echo'd html within PHP
(all those escaped characters - makes it look really untidy.)

a nice article:

http://www.devarticles.com/c/a/PHP/Some-PHP-Guidelines-to-Live-By

(I do hope you haven't started a war!)

;o)


More information about the thelist mailing list