At 23:02 02.03.2003, [EMAIL PROTECTED] said:
--------------------[snip]-------------------- 
>Can someone tell me what is wrong with the following code:
>
><?php $str = << 
>This is code straight out of the PHP manual. I get the error:
>Parse error: parse error, unexpected T_SL in testhere.php on line 5
>
>I looked up T_SL and it is a token representing << so that means it just
>doesn't get the <<<. Why not? I've tried all the combinations of spaces and
>no space in that line that I can think of.
--------------------[snip]-------------------- 

The correct heredoc syntax:

$text = <<<EOT
This is
all
a heredoc
text
EOT;

Note: the heredoc delimiter
1) must not be indented
2) must be all lone on a single line (except an optional terminating semicolon)


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to