Page 1 of 1

large php sections vs. multiple php sections in html

Posted: Fri Dec 19, 2008 11:57 am
by ehogan
Has there been any study as to which style practice is more efficient/faster on a webserver.

HTML that looks this, with multiple php sections:

Code: Select all

 
 <tag> blah </tag>
<?php some_php_function() ?>
 <tag> blah </tag>
 <tag> blah </tag>
<?php some_other_php_function() ?>
 <tag> blah </tag>
 
or code that looks like this with a single large php section:

Code: Select all

 
 <tag> blah </tag>
<?php some_php_function()
echo " <tag> blah </tag>\n";
echo " <tag> blah </tag>\n";
    some_other_php_function() ?>
 <tag> blah </tag>
 

Re: large php sections vs. multiple php sections in html

Posted: Fri Dec 19, 2008 12:17 pm
by Christopher
I doubt if there is much if any difference. And you application is accessing any subsystem, such as a database, this code is a very insignificant part of the total time taken per request.