PHP: multi-line print?

liunx

Guest
hey everybody...been a long time since I last posted here :p anyway....
Ok, I am working on a CMS project for my site, and I have a whole lot of it done (yay!). I have come to parts where I have to print lots of html stuff (for control panel).

As far as I know, in PHP, you have to make a print ""; for each separate line (unless you want to have a super long string that stretches the screen an absurd amount).
I know that in Perl, you could just use

print qq~
all html code here,
formatted however you want,
you don't need to backslash escape any special symbols.
~;


I want to know, is there anything like that in PHP? It would make this a lot easier for me (I know, I know...I'm being lazy). This is mainly only for testing purposes. After I have all the html and code stuff done, I plan to move all the html blocks into the db and have it grab the html from there like it does with the pages.well this is very valid


echo" some text
to output
to the screen";

// or you can use here-doc syntax

echo <<<myHtml
some txt here also some html and you can also use "
in this syntax without escaping them.
the ending is the same as the begining

myHtml;



that works well too.thx for enlightening me.Is there anything like that for assigning a value to a variable?

EX(in perl you could):
$HTML = qq~ your html code ~;no, you have to escape the quotes.Darn...that's disappointing.

oh well, Thanks for info.
 
Back
Top