Remove waste whitespaces from HTML-code

Snippet for removing waste whitespaces from HTML-code.
1
2
3
4
function minify($sHTML)
{
   return preg_replace('/([\s\t\n]*)(<.*>)([\s\t\n]*)/''$2'$sHTML);
}
X

Url: http://sklueh.de/2012/06/entfernen-von-uberflussigen-whitespaces-aus-html-code-mit-php/

Language: PHP | User: sklueh | Created: Sep 24, 2013