function HTMLCleaner($Data, $StripOther=true, $StripHeader=true, $StripStyles=true, $StripClass=true, $StripSpan=true, $StripEmpty=true){ $NLSeparator = "___HTMLCleaner___NEW___LINE___"; $buff = ereg_replace("[ ]{0,}[\n\r]{1,}", "$NLSeparator", $Data); if( $StripHeader ){ $buff = ereg_replace("", "", $buff); $buff = ereg_replace("", "", $buff); $buff = ereg_replace("
]*>/i", "", $buff); $buff = preg_replace("/.*<\/head>/i", "", $buff); } if( $StripOther ){ $buff = ereg_replace("", "", $buff); $buff = ereg_replace("", "", $buff); $buff = ereg_replace("", "", $buff); if( $StripEmpty ){ $buff = ereg_replace(" ", " ", $buff); // $buff = preg_replace("/[ \n\r\t]*/", " ", $buff); $buff = ereg_replace("", "", $buff); $buff = ereg_replace(" ", "", $buff); $buff = ereg_replace("", "", $buff); $buff = ereg_replace(" ", "", $buff); $buff = ereg_replace("", "", $buff); $buff = ereg_replace("
", "", $buff); $buff = ereg_replace(" ", " ", $buff); } if( strpos($buff, "
") ){ //
tags present, so let's try to do intelligent format $buff = str_replace ($NLSeparator, "\n", $buff); $buff = str_replace ("\n\n", "\n", $buff); // $buff = str_replace ("
", "\n
", $buff); $buff = str_replace ("
", "\n", $buff); $buff = str_replace ("", "\n", $buff); $buff = str_replace ("", "\n", $buff); $buff = str_replace ("", "\n", $buff); $buff = str_replace ("", "\n", $buff); $buff = str_replace ("", "\n", $buff); $buff = str_replace ("", "\n", $buff); $buff = str_replace ("