You are here: Re: ECHO or concatenation with single quote, for performance? « PHP Programming Language « IT news, forums, messages
Re: ECHO or concatenation with single quote, for performance?

Posted by Tom on 05/30/07 18:29

On 30 May 2007 10:20:56 -0700, L. Berger wrote...
>
>Hi,
>
>I am working on an HTML template which has a lot of html tags, with
>PHP data shown in the middle of these tags -- you know, the usual.
>Currently, I have HTML as is, and many many "echo $variable"
>statements mixed in as PHP code.
>
>My question: should I leave it like this, with ECHO statements
>embedded within the tags,
>
>Or
>
>Should I concatenate the HTML within single quotes (single quotes are
>supposed to be faster in PHP than double quotes) and the display data
>as variables, and then ECHO that one concatenated string?
>
>Any experiences or pointers would be great!
>
>Thanks
>LB
>

From my understanding PHP would see a single-quoted string of text as a block of
text or a single variable, but double-quoted text may have other variables
inside.

Depending on the volume that PHP would need to parse in a document, you may or
may not notice a difference. For future purposes though it may be worth using
the single-quotes when applicable.

Tom
--
Newsguy.com - Unlimited Accounts
Now with 32 concurrent connections

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация