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 characters
| // Minify HTML on The Fly Wordpress | |
| // http://ermawan.com/php-minify-html-on-the-fly | |
| function minify_html($buffer) { | |
| $search = array( | |
| '/\>[^\S ]+/s', // strip whitespaces after tags, except space | |
| '/[^\S ]+\</s', // strip whitespaces before tags, except space | |
| '/(\s)+/s' // shorten multiple whitespace sequences | |
| ); | |
| $replace = array( | |
| '>', |
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 characters
| // FUNCTION TO CREATE REDIRECT! | |
| function redirect($to, $type=301){ | |
| if ($type == 301) header("HTTP/1.1 301 Moved Permanently"); | |
| header("Location: $to"); | |
| exit(); | |
| } |