You could capture the content in a variable first and then run:
$nolines = str_replace(array("\n", "\r"),'<br>', $var);
You could capture the content in a variable first and then run:
$nolines = str_replace(array("\n", "\r"),'<br>', $var);