Right now I’m assigning HTML to a variable the usual way:
$var = <<<END
<blah>...</blah>
END;
The big disadvantage is that my IDE won’t treat this as HTML, and so it won’t highlight the code. Is there a way to do it that will keep the HTML outside of the <?php ?> tags so that code highlighting will work?
If you’re printing, you could always just exit PHP and go back in whenever you like:
Alternatively, you could use buffers to use that technique to assign them to variables: