By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,772 Members | 1,272 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,772 IT Pros & Developers. It's quick & easy.

inserting html

P: n/a
I know in cgi/perl coding you can enter html in between

print<<"stop_until_eof";
<b>text</b>
stop_until_eof

Does php work the same way ?

Thanks,
Chris

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
so**********@yahoo.com wrote:
I know in cgi/perl coding you can enter html in between

print<<"stop_until_eof";
<b>text</b>
stop_until_eof

Does php work the same way ?


PHP is very similar:

print <<<stop_until_eof
<b>text</b>
stop_until_eof;

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Jul 17 '05 #2

P: n/a
so**********@yahoo.com wrote:
I know in cgi/perl coding you can enter html in between

print<<"stop_until_eof";
<b>text</b>
stop_until_eof

Does php work the same way ?


Yes, you can do basically the same thing. Reading the PHP help about
"echo" shows the following:

echo <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon. no extra whitespace!
END;

Or if all you want to do is echo till the end of the file, just:

"<?PHP

code here...
?>
The rest of the file goes here."

Cheers,
Nicholas Sherlock
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.