A Question with heredoc
| From: | Simon Coggins | Date: | Sun, 08 Jun 2003 09:10:06 +0000 |
| Subject: | A Question with heredoc | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150660@lists.php.net to get a copy of this message | ||
Hi
I'm writing a wrapper for some mailman archives and i'm trying to put
them message into a variable as in:
$body = <<<EOF
text here.....
EOF;
But I'm getting an error because of some charactors. ^L to be
specific. If the text contains a control char I get:
Code:
<pre>
<?
$test = <<<EOF
line 1
^L
line 2
EOF;
echo $test;
?>
</pre>
Error:
Warning: Unexpected character in input: '' (ASCII=12) state=5 in
test.html on line 6
Is there any way I can stop it complaining about it. Or is there
another way I can put the the text into the string (it's done via a
template file and a string substitution). The contents could be
anything so I thougth heredoc would work..
Thanks in advance.. I'm not on the list so please reply to me directly.
Regards
Simon
--
Simon Coggins (SAGE-AU Member) Email: simon@uow.edu.au
Network and System Management Officer Phone: +61-2-4221-3775
Information Technology Systems (ITS) Mobile: 0408 115861
University of Wollongong, 2522, Australia Fax: +61-2-4229-1985