Okay, I didnt try the example until now..
I removed the stripslashes from the $r = new rtf() statement:
function remove_rtf($rtf) {
$r = new rtf($rtf);
$r->output("html");
$r->parse();
if(count($r->err) == 0)
return strip_tags($r->out);
}
Of course there is now a downside, I didnt realize this about the way it converts it, but it all goes to one single line, making it faintly effective at converting to HTML.
The Class is a VERY good start, and could probably be modified to suit your needs, its too much for me to do (I am @ work).