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 lik
Basically you can put HTML anywhere outside of PHP tags. It's also very beneficial to do all your necessary data processing before displaying any data, in order to separate logic and presentation.
The data display itself could be at the bottom of the same PHP file or you could include a separate PHP file consisting of mostly HTML.
I prefer this compact style:
=$title?>
=$item?>
Note: you may need to use instead of
=$var?>
depending on your PHP setup.