Advertisement
WILDAN_IZZUDIN

SOURCE MINIFIER

Nov 7th, 2018
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. <?php
  2. function sanitize_output($buffer) {
  3.     $search = array(
  4.         '/\>[^\S ]+/s',
  5.         '/[^\S ]+\</s',
  6.         '/(\s)+/s',
  7.         '/<!--(.|\s)*?-->/'
  8.     );
  9.     $replace = array(
  10.         '>',
  11.         '<',
  12.         '\\1',
  13.         ''
  14.     );
  15.     $buffer = preg_replace($search, $replace, $buffer);
  16.     return $buffer;
  17. }
  18. ob_start("sanitize_output");
  19. header("Content-Type: text/html; charset=utf-8");
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement