$searchaborative = array( "///<[/!]*?[^//<//>]*?//>/si", "//t/", "/[/r/n]+/", "/(^[/r/n]|[/r/n]/$)+/", "/&(quot|#34);/i", "/&(amp|#38);/i", "/&(lt|#60);/i", "/&(gt|#62);/i", "/&(nbsp|#160|/t);/i", "/&(iexcl|#161);/i", "/&(cent|#162);/i", "/&(pound|#163);/i", "/&(copy|#169);/i", "/&#(//d+);/e"); $replaceaborative = array("", "", "/r/n", "", "/"", "&", "<", ">", " ", chr(161), chr(162), chr(163), chr(169), "chr(//1)"); $txt = preg_replace($searchaborative, $replaceaborative, $html);