This function I use to strip html to text and it works perfectly. The main problem is storing a string to the mysql
function html2text($string)
{
// Remove links
$string = ereg_replace("<a href=[^>]*>", "", $string);
$string = ereg_replace("</a>", "", $string);
// escape /*_ chars (but NOT / after < or before >)
$string = ereg_replace("([^<])([*_/])([^>])", "\\1\\\\\\2\\3", $string);
// underline
$string = ereg_replace("<u>", "_", $string);
$string = ereg_replace("</u>", "_", $string);
// italic
$string = ereg_replace("<i>", "", $string);
$string = ereg_replace("</i>", "", $string);
// newlines: php retains \n's, so just remove
$string = ereg_replace("<br>", "", $string);
$string = ereg_replace("<br />", "", $string);
return $string;
}