public static function sanitizeOutput($buffer)
    {
        if (!isset($_GET['unsanitized'])) {
            $search = array(
                '/\>[^\S ]+/s',     // strip whitespaces after tags, except space
                '/[^\S ]+\</s',     // strip whitespaces before tags, except space
                '/(\s)+/s',         // shorten multiple whitespace sequences
                '/<!--(.|\s)*?-->/' // Remove HTML comments
            );

            $replace = array(
                '>',
                '<',
                '\\1',
                ''
            );

            $buffer = preg_replace($search, $replace, $buffer);

            return $buffer;
        }

        return $buffer;
    }
public static function sanitizeOutput($buffer)
    {
        if (!isset($_GET['unsanitized'])) {
            $search = array(
                '/\>[^\S ]+/s',     // strip whitespaces after tags, except space
                '/[^\S ]+\</s',     // strip whitespaces before tags, except space
                '/(\s)+/s',         // shorten multiple whitespace sequences
                '/<!--(.|\s)*?-->/' // Remove HTML comments
            );

            $replace = array(
                '>',
                '<',
                '\\1',
                ''
            );

            $buffer = preg_replace($search, $replace, $buffer);

            return $buffer;
        }

        return $buffer;
    }
public static function sanitizeOutput ( $ buffer ) { if ( ! isset ( $ _GET [ 'unsanitized' ] ) ) { $ search = array ( '/\>[^\S ]+/s' , // strip whitespaces after tags, except space '/[^\S ]+\</s' , // strip whitespaces before tags, except space '/(\s)+/s' , // shorten multiple whitespace sequences '/<!--(.|\s)*?-->/' // Remove HTML comments ) ; $ replace = array ( '>' , '<' , '\\1' , '' ) ; $ buffer = preg_replace ( $ search , $ replace , $ buffer ) ; return $ buffer ; } return $ buffer ; }
Minify the html for the outputbuffer

@param $buffer
@return mixed
Minify the html for the outputbuffer