Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save azuya/9dab35ebd2a7873cffd46b0ed8747663 to your computer and use it in GitHub Desktop.
Save azuya/9dab35ebd2a7873cffd46b0ed8747663 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