Page 1 of 1

Get multiple lines into a variable over multiple lines

Posted: Sat Mar 13, 2004 11:29 pm
by Stryks
Sorry about the subject line ... I dont really know how else to describe what I'm looking for.

I've seen some code somewhere that allows you to start putting lines into a variable until you close it, or at least that is how I understood it at the time.

I'm pretty sure that at the end you had to put END; and you had to be specific about the spaces and so on or it wouldnt work.

What I'm picturing went something like ...

Code: Select all

...
...
This is text
And so is this
END;
The idea I think was that the text would appear like that when displayed.

Can anyone figure out what I'm looking for here ... I've just confused myself. :?

Re: Get multiple lines into a variable over multiple lines

Posted: Sat Mar 13, 2004 11:37 pm
by TheBentinel.com
Stryks wrote: What I'm picturing went something like ...

Code: Select all

...
...
This is text
And so is this
END;
It sounds like you're shooting for a "here document". Here's a URL that shows the syntax and describes a common way to get bitten while using them:
http://www.zend.com/tips/tips.php?id=174&single=1

Hope it helps!