How do I echo a lot of html code, I thought there was a function like
to output html without worrying about quotes and semicolons all the timePHP Code:echo >>end
...
...
html code
...
...
end;
| SitePoint Sponsor |





How do I echo a lot of html code, I thought there was a function like
to output html without worrying about quotes and semicolons all the timePHP Code:echo >>end
...
...
html code
...
...
end;
"Oh, and Jenkins--apparently your mother died this morning."


Not something I tend to use or have used for a long time, but I think what you need is
PHP Code:echo <<<__HTML_END
<!-- HTML here -->
__HTML_END;
You're thinking of Heredoc. You need to remember with heredoc that the opening and closing "tags" can't be indented at all.l
Community Team Advisor
Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator
Also
is the same withCode:<?php echo <<<FOOBAR Hello World! FOOBAR; ?>
but not withCode:<?php echo <<<"FOOBAR" Hello World! FOOBAR; ?>
if you need variables into your text.Code:<?php echo <<<'FOOBAR' Hello World! FOOBAR; ?>

Much easier to flip around the other way and use <?php ?> when you need to do something
<?php//Kyle Wolfeecho devBlog("My Dev Notes");





ok, thanks
"Oh, and Jenkins--apparently your mother died this morning."
Bookmarks