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