Last active
December 12, 2016 08:45
-
-
Save imlinus/6671d49b7d79f885a4884c202210bd19 to your computer and use it in GitHub Desktop.
Revisions
-
Linus Lilja revised this gist
Dec 12, 2016 . No changes.There are no files selected for viewing
-
Linus Lilja created this gist
Dec 12, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ <?php function compress_page($buffer) { $search = array("/<!–\{(.*?)\}–>|<!–(.*?)–>|[\t\r\n]|<!–|–>|\/\/ <!–|\/\/ –>|<!\[CDATA\[|\/\/ \]\]>|\]\]>|\/\/\]\]>|\/\/<!\[CDATA\[/" => ""); $buffer = preg_replace(array_keys($search), array_values($search), $buffer); return $buffer; } ob_start('compress_page'); // Page here ob_end_flush(); ?>