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:
$code = "<html>
<body>";
Will minify it to one line. I am not looking for something like the YUI Compressor, 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?