Re: [PHP3] multilined string assignment like perl's <<END syntax ?
| From: | Cynic | Date: | Wed, 16 Feb 2000 16:10:19 +0000 |
| Subject: | Re: [PHP3] multilined string assignment like perl's <<END syntax ? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10360@lists.php.net to get a copy of this message | ||
Hm, I've just tried that (copy&paste from the manual), and
ended up with a parse error on the $str = >>>EOD line.
I have a question for developers: is there a newer build of
PHP4 than the b3? pre-beta4 php.exe fails with a msgbox
saying "The procedure entry point php-ini-path could not be
located in the dynamic link library php4ts.dll" followed by
an "Internal server error" in the browser. (Yes, I've tried
both b3 and pre-b4 php4ts.dlls.) I'm not a programmer, don't
want to compile anything. Just working binaries for win32
env, please.
At 10:53 AM 2/16/00 -0500, Greg Wallis wrote the following:
Thanks for the link, cynic.
Do here docs work for you, and if so, what version of php are you
running?
I'm running 4.03b and the parser does not recognise the >>>
syntax.
Greg
----- Original Message -----
From: Cynic <cynic@mail.cz>
To: Greg Wallis <greg@practicalsoftware.net>
Sent: Wednesday, February 16, 2000 10:29 AM
Subject: Re: [PHP3] multilined string assignment like perl's <<END
syntax ?
> yes.
>
>
http://www.php.net/manual/language.types.string.php3
>
> At 10:16 AM 2/16/00 -0500, Greg Wallis wrote the following:
>
> Hi,
>
> I've got several lines of html that I need to assign to
a variable.
> Conventional assignment is a bit of a pain in this case,
because there
are
> so many lines.
>
> Perl offers a nice solution where you can use a
<<END operator. (I
think
> they call it "here documents")
>
> EXAMPLE:
> $s = <<END;
> line1
> line2
> line3
> END
>
> In perl, this assigns everything up to END to $s.
>
> Is there something similar in PHP ?
>
> ____________________________________________________________
> Cynic:
>
> A member of a group of ancient Greek philosophers who taught
> that virtue constitutes happiness and that self control is
> the essential part of virtue.
>
>
mailto:cynic@mail.cz
> ICQ: 2808 2505
>
>
>
>
>
>
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
mailto:cynic@mail.cz
ICQ: 2808 2505