I know it's a very small performance tweak but I would like to minify an HTML document that has PHP embedded inside of it.
For example:
<div id="header">
<?php
echo "<ul>\n<li>";
echo $somevar;
echo "</li>\n<ul>\n";
?>
</div>
Would produce an output of:
<div id="header">
<ul>
<li>Foobar</li>
<ul>
</div>
But I would like for the output to be minified. I can manually remove spaces and line endings from the PHP output, so it looks like so:
<div id="header">
<ul><li>Foobar</li><ul></div>
But the surrounding HTML document needs to be minified as well. How can this be done? (Imagining this example in a larger document context.)