/ Published in: PHP
Place this at the top of your php files. This will remove white space and formatting from HTML, making it smaller and faster for download by your users.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function sanitize_output($buffer) { '/\>[^\S ]+/s', //strip whitespaces after tags, except space '/[^\S ]+\</s', //strip whitespaces before tags, except space '/(\s)+/s' // shorten multiple whitespace sequences ); '>', '<', '\\1' ); return $buffer; } ?>
URL: http://ru.php.net/manual/en/function.ob-start.php#71953