function cleanit($string)
{
$string=str_replace("$","\$",$string);
$string=strip_tags($string);
$string=str_replace("\n\n","<p>",$string);
$string=str_replace("\n","<br>",$string);
return $string;
}
I have the above function to clean up user added text in a messageboard I'm writing. My problem is the line that replaces 2 newlines with a <p> doesn't work and it's throwing my formatting off. Can anyone tell me why?
Thanks!:p