Skip to content

Instantly share code, notes, and snippets.

@MarcosBL
Created April 26, 2015 17:39
Show Gist options
  • Select an option

  • Save MarcosBL/b103895dd5e4478f70ee to your computer and use it in GitHub Desktop.

Select an option

Save MarcosBL/b103895dd5e4478f70ee to your computer and use it in GitHub Desktop.
Maximum Compress HTML using weird tricks
<?php
$to_cache = str_replace(array("</option>","</td>","</tr>","</th>","</dt>","</dd>","</li>","</body>","</html>"),"",$to_cache);
$to_cache = preg_replace('/(href|src|id|class|name|type|rel|sizes|lang|title|itemtype|itemprop)=(\"|\')([^\"\'\`=<>\s]+)(\"|\')/i', '$1=$3', $to_cache);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment