title: Using PHP to minify JavaScript, HTML, and CSS WITHIN A STRING
body: <p>All of the PHP minify functions I've seen have dealt with physical JavaScript, HTML, CSS files. I would like a function that, when given something like this:</p>
  
  <pre><code>$code = "&lt;html&gt;
      &lt;body&gt;";
  </code></pre>
  
  <p>Will minify it to one line. I am not looking for something like the <a href="https://en.wikipedia.org/wiki/YUI_Library#Build_tools" rel="nofollow noreferrer">YUI Compressor</a>, as that deals with files on a server. I would simply like a function that minifies a string passed to it. Does this exist anywhere?</p>