phpclasses9865 (adjusted to work with php8+)
This is a demonstration of the html minifier using phpclasses9865 (adjusted to work with php8+) class
Input html:
Output:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html> <head> <style>.container{padding:0px 0px 0px 0px;margin-left:9px;}.container{text-align:right;width:calc(100% - 30px);}</style> <script>var _elems=[];var _arr2=[];window.addEventListener('load',function(){_elems=document.getElementsByClassName('DIV');console.log(_elems.length);});function doSomething(elem,catchFg){doSomethingElse(elem,catchFg,"stop");}</script> </head> <body>Lorem ipsum delor <table> <tr> <td> Lorem <input type="search" onkeyup='typewatch(this,"doMyAssetFilter()",300)'/> </td> <td onclick="doSomething()"> Ipsum </td> </tr> </table> Lorem Ipsum Delor!</body> </html>
Minify time: 0.0038 seconds; 713 bytes 77.75% of original size (from 917 bytes).