Posted by ZeldorBlat on 03/28/07 01:42
On Mar 27, 4:26 pm, "Laiverd.COM" <share_your_knowle...@someserver.nl>
wrote:
> Simple question on which I could not find an answer. How would I - if
> possible at all - call a function within a heredoc block of text? Example
>
> function showSomething(){
> echo <<<END
> A long block of text with a function() in the middle.
> END
>
> }
>
> Thanks for any input.
>
> John
As far as I know you can't. The parser is looking for tokens
beginning with $ (i.e. variables) inside the heredoc block. Your best
bet is to just assign the result of your function to a variable before
the heredoc block, then include the variable in the text.
[Back to original message]
|