Posted by Richard Levasseur on 08/20/06 20:27
a.r.austin@gmail.com wrote:
> There was some PHP built in syntax method to enter huge strings as
> blocks of text.
>
> I don't remember exactly how it goes and not many people use it, thus,
> google search was unsuccessful to me:
>
> $a = [MYKEY]
> text text text
> [/MYKEY];
>
> Well, it went something like that... Anyone can help me remember
> exactly what was the syntax and a correct name of this method?
You must be refering to HEREDOC syntax.
echo <<<TOKEN
text $variable "quotes" 'single'
TOKEN;
The ending TOKEN must begin at column one. Any white space before it
will not be stripped out, and PHP will not recognize it as the end of
the HEREDOC block.
[Back to original message]
|