Skip to content

Instantly share code, notes, and snippets.

@BillKracke
Created November 20, 2013 16:51
Show Gist options
  • Save BillKracke/7566629 to your computer and use it in GitHub Desktop.
Save BillKracke/7566629 to your computer and use it in GitHub Desktop.
// Clean MS Word tags and other junk
function cleanHTML($html) {
$html = ereg_replace("<(/)?(font|span|del|ins)[^>]*>","",$html);
$html = ereg_replace("<([^>]*)(class|lang|style|size|face)=("[^"]*"|'[^']*'|[^>]+)([^>]*)>","<\1>",$html);
$html = ereg_replace("<([^>]*)(class|lang|style|size|face)=("[^"]*"|'[^']*'|[^>]+)([^>]*)>","<\1>",$html);
return $html
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment