This is some examples I got from php.net 's function list.
I do not know if it works, but I guess it's worht a try:
Example 3. Convert HTML to text
// $document should contain an HTML document.
// This will remove HTML tags, javascript sections
// and white space. It will also convert some
// common HTML entities to their text equivalent.
$search = array ("'<script[>]?>.?</script>'si", // Strip out javascript
"'<[\/!]?[<>]?>'si", // Strip out html tags
"'([\r\n])[\s]+'", // Strip out white space
"'&(quot|#34);'i", // Replace html entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e"); // evaluate as php
$replace = array ("",
"",
"\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\1)");
$text = preg_replace ($search, $replace, $document);
For more examples, try;
http://www.brokenplanet.net/php/convert_tag.phps
or the php function list and look at the examples;
http://www.php.net/manual/en/function.htmlspecialchars.php