Re: heredoc syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Janet Valade <jvalade@xxxxxxxx>:
> Adil wrote:
>
>> anyone know why heredoc syntax might not work with php5/apache installed.  I
>> can't get even the simplest strings in heredoc syntax to work and I've tried
>> just cutting and pasting other peoples stuff in that syntax as well, and
>> still no luck
>
> Heredoc syntax is pretty rigid and it's easy to have it wrong invisibly.
                                                                ^^^^^^^^^
That's the key -- whitespace is invisible to the naked eye typically.

> $varname = <<<END
> Text of string
> END;
>
> The first END must be at the end of the line, nothing after it, not even 
> a blank space. The last END must be at the beginning of the line, not 
> before it, not even a blank space.

And don't forget that the last END must be followed by a semi-colon
ONLY, no other characters on that line... ;-)

-- 
Matthew Weier O'Phinney           | mailto:matthew@xxxxxxxxxx
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux