on-internet
← Community

How can I echo HTML in PHP?

Stack Overflow ·

I want to conditionally output HTML to generate a page, so what's the easiest way to echo multiline snippets of HTML in PHP 4+? Would I need to use a template framework like Smarty? echo '<html>', "\n"; // I'm sure there's a better way! echo '<head>', "\n"; echo '</head>', "\n"; echo '<body>', "\n"; echo '</body>', "\n"; echo '</html>', "\n";

Comments

Sign in or sign up to comment and upvote.

No comments yet.