Skip to content

Instantly share code, notes, and snippets.

View maximuspoder's full-sized avatar

Fernando Alves maximuspoder

View GitHub Profile
<?php
function sanitize_output($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
'/<!--(.|\s)*?-->/' // Remove HTML comments
);