NYCPHP Meetup

NYPHP.org

[nycphp-talk] testing a theory

David Krings ramons at gmx.net
Wed Feb 7 06:37:16 EST 2007


Urb LeJeune wrote:
> I did a performance test on just this type of thing and there was no
> discernable difference. Why not do the following which makes the
> code much easier to follow and modify
> 
> $Content=<<<Content
> this is the start of a bunch of lines.
> another line,
> yet another.
> Content;
> 
> echo $Content;
> 
> It's called a "here document" structure and can include variables.
> 
> One note of caution. There can be no spaces at the end of either the
> first or second "Content" and the last one must begin in column one.
> 
> Urb
> 

And I guess you cannot use
Content;
as part of the document. Do I assume right that it doesn't have to be 
"Content" as keyword, but can be "gnurfzz345"? The <<< should be the 
identifier for the whole thing.

This is good to know and looks so uncodely. ;)
David



More information about the talk mailing list