Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ob_start('cleanOutput');
- function cleanOutput($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(
- '>', '<', '\\1'
- );
- $buffer = preg_replace($search, $replace, $buffer);
- return $buffer;
- }
Advertisement
Add Comment
Please, Sign In to add comment