$htmlfree makes use of a regular expression to remove HTML tags from text. This is an alternate version of it.