[thelist] PHP inside or outside?

Kinjal Dixit kinjal at tendercity.com
Sat Apr 24 06:56:26 CDT 2004


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?

AFAIK, all the "external" HTML is anyway converted to echo statements.  So
embedding them the way you do should be faster, split-second wise.

Should the difference be irrelevant, what, to you, seems to be the best
practice?

IMHO, keeping the html outside is better because that allows me to use tools
like macromedia dreamweaver to get a preview.  Also doing this "separates
presentation from processing" which starts paying off as the complexity
grows.

regards

kinjal




More information about the thelist mailing list