Re: [PHP] echo w/ here document

2002-11-11 Thread @ Edwin
Hello Marco,

"Marco Tabini" <[EMAIL PROTECTED]> wrote:

> You need to remove the semicolon from the beginning of your heredoc
> expression. The semicolon tells PHP (incorrectly) that the instruction
> terminates, while in fact it doesn't:

I think...

>  $name="John Doe"

you meant the semicolon at the end of ENDOFECHO; (below) and NOT at the end
of "John Doe"; (above)  ;)

- E

> echo <<< ENDOFECHO;
> 
> 
> ECHO TEST
> Hello, $name.
> 
> 
> ENDOFECHO;
> ?>
>
> This will work.
>
>


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




Re: [PHP] echo w/ here document

2002-11-11 Thread Marco Tabini
You need to remove the semicolon from the beginning of your heredoc
expression. The semicolon tells PHP (incorrectly) that the instruction
terminates, while in fact it doesn't:




ECHO TEST
Hello, $name.


ENDOFECHO;
?>

This will work.


Marco

-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!

--- Begin Message ---
Hi,

I'm having trouble using echo w/ here document syntax. When I run


$name="John Doe";
echo <<< ENDOFECHO;


ECHO TEST
Hello, $name.


ENDOFECHO;
?>

I get a parse error line 1. I've been through it a dozen times and 
combed all the docs I could find on the matter, but I can't find where 
I've gone wrong. Any help would be greatly appreciated.

Craig Buxton
Gravity Pilot Productions
[EMAIL PROTECTED]


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


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