Possible Duplicate:
PHP <<<EOB
I saw this below piece of code in one php file , can some one explain what <<< st means.?
$status['caption']=<<<ST
ST;
P.s : I really cant google it , trust me :D
Possible Duplicate:
PHP <<<EOB
I saw this below piece of code in one php file , can some one explain what <<< st means.?
$status['caption']=<<<ST
ST;
P.s : I really cant google it , trust me :D
That is a way to store multiline strings. (Called Heredoc Syntax)
$string = <<<IDENTIFIER
IDENTIFIER;
All the lines in between are stored as string. Used for long walls of text. It is described here.
It is called the Heredoc syntax: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
It can be helpful for multiline strings and strings containing both double and single quotes. As double quotes Heredoc interprets many escape sequences for special characters.
The <<< operator stands for the heredoc syntax. It's a way to write strings in a natural way.
http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
That's a heredoc string ("text block").
Everything between <<<ST and ST
; will be output as it is written. So you could put some HTML you want to output and save a bunch of print() statements or save your self the work of escaping characters like you would with a $variable = " textity text text text";
command.
From php website : Heredoc text behaves just like a double-quoted string, without the double quotes. This means that quotes in a heredoc do not need to be escaped, but the escape codes listed above can still be used. Variables are expanded, but the same care must be taken when expressing complex variables inside a heredoc as with strings.