[SOLVED]heredoc - use restricted only to echo...
Posted: Tue Jun 08, 2004 11:42 am
Very quick question.
I've just started PHP and I'm working steadily on a PHP-based site, using whatever tricks I can learn.
The other day someone informed me about heredoc syntax - wow!!
That's pretty useful rather than having to escape quotes etc.
My question is, can heredoc syntax only be used for the echo command like below...?
Or can you also use it for the setting of variables for example?
Thanks
I've just started PHP and I'm working steadily on a PHP-based site, using whatever tricks I can learn.
The other day someone informed me about heredoc syntax - wow!!
That's pretty useful rather than having to escape quotes etc.
My question is, can heredoc syntax only be used for the echo command like below...?
Code: Select all
echo <<<HTML
.....
HTML;Code: Select all
$foo = <<<HTML
all sorts of stuff here
HTML;