how do i detect if a user has put in a line break in a text area field. This forum can do it, so why can't i?
$str = str_replace("\n", "<br>", $str);
Better yet:
$str = nl2br($str);
I've tested both variants - and both are wrong. You need:
$str = str_replace("\r\n", "<br>", $str); $str = str_replace("\n", "<br>", $str); $str = str_replace("\r", "<br>", $str);