depending on the requirements of your script, it is quicker to use <? echo
$var; ?> as required, this is because php essentially ignores all the html
tags untill a <? ... ?> is found for which php does it's stuff...

if you use

large echo "..."; statements here and there...


PHP has to go thru the contents of "..." and repace any variables it

however if you are echo'ing without variables always use '...' and not "..."
as the single quotes state that it's just text and so it does'nt need to
parse this just output it. You can do 'some text'.$aVariable.' more text';
which will be quicker that "some text $aVariable more text"; to process...

As I said at the start, it very much depends on what is required for a
particular script...

Also, it is better to choose a style and stick to it! And only break your
own style when the need calls for it.


IT/Web Apps Specialist --

"Tony Crockford" <[EMAIL PROTECTED]> wrote in message
> Hi,
> I'm sure this is an RTFM, but I'm not sure where I should be looking.
> is it quicker for PHP to execute <? echo $var ?> in blocks of html or to
> echo all of the html and only have one <? and ?>
> I'm using a PHP script to write a lot of html files to hard disk and the
> script execution time is climbing beyond the maximum set in PHP.ini
> (I've changed the setting, but...)
> I'm looking to shave milliseconds of each execution, any ideas, pointers
> or tutorials you could point me to.
> Thanks
> Tony

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to