", "", $buff); $buff = ereg_replace("", "", $buff); $buff = ereg_replace("", "", $buff); $buff = preg_replace("/]*>/i", "", $buff); $buff = preg_replace("/.*<\/head>/i", "", $buff); } if( $StripOther ){ $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); $buff = ereg_replace("", "", $buff); // $buff = ereg_replace("", "", $buff); // $buff = ereg_replace("", "", $buff); } if( $StripSpan ){ $buff = preg_replace("/]*>/i", "", $buff); $buff = preg_replace("/<\/span[^>]*>/i", "", $buff); $buff = preg_replace("/]*>/i", "", $buff); $buff = preg_replace("/<\/div[^>]*>/i", "", $buff); } if( $StripStyles ){ $buff = preg_replace("/[ \n\r\t]*style='[^']*'/i", "", $buff); $buff = preg_replace("/[ \n\r\t]*style=\"[^\"]*\"/i", "", $buff); // $buff = preg_replace("/[ \n\r\t]*style=[^ ]*/", "", $buff); } if( $StripClass ){ $buff = preg_replace("/[ \n\r\t]*class=[^ >]*/i", "", $buff); $buff = preg_replace("/[ \n\r\t]*class=\"[^\"]*\"/i", "", $buff); $buff = preg_replace("/[ \n\r\t]*class='[^']*'/i", "", $buff); } $buff = preg_replace("/\ \;\ \;/i", " ", $buff); $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 ("
    ", "
      \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 = ereg_replace("\n\n", "\n", $buff); $buff = ereg_replace("\r\n\r\n", "\r\n", $buff); $buff = ereg_replace("\n\r\n\r", "\n\r", $buff); $buff = ereg_replace("\r\r", "\r", $buff); /* $buffA = split("[\n\r]", $buff); if( is_array($buffA) ){ $buff = ""; for($cnt=0; $cnt tags, so insert newlines $buff = ereg_replace($NLSeparator, "\n", $buff); } return $buff; } $THEARTICLE = HTMLCleaner( $THEARTICLE, $StripOther=true, $StripHeader=true, $HTML_CLR_STYLE=="Y", $HTML_CLR_CLASS=="Y", $HTML_CLR_SPAN=="Y", $HTML_CLR_EMPTY=="Y"); ?> HTML CLEANER
          HTML:
          Remove: SPAN tags, CLASS args, STYLE args, empty space