Re: Perl user question
| From: | Hardy Merrill | Date: | Tue, 28 Nov 2000 22:07:58 +0000 |
| Subject: | Re: Perl user question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27691@lists.php.net to get a copy of this message | ||
Do you mean a "here-document"? Perl uses a <<, and PHP has the
same functionality, only with one more less than sign <<<.
Here's a here document in PHP:
print <<< END_HTML
some
stuff
interpolate $some_variable
more stuff
END_HTML;
-----------------------
One gotcha - remember to put your ending tag at the *start* of
the line. It won't work if your end tag is anywhere but at the
very beginning of the line.
HTH.
--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com
Jean-Marc Lecarpentier [lecarpentier@iutc3.unicaen.fr] wrote:
> Hi,
> Before I start with PHP I used to use perl cgis a couple of years ago.
> And if i remember correcly with Perl one can print a long text using
> only one print like (there might be some < or > missing) :
>
> print text
> all_the_text_i_want_with_variables_interpreted
> text
> And perl would stop the print when text appeared by itself on the line.
>
> Here is my question : can we do that kind of thing with PHp?? I thought
> i had read that somewhere but now i can't find it (maybe it was in my
> dreams;-)
> JM
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net