php ganti n oleh
$var = str_replace(array("\r\n","\n"),'<br>', $var);
adriendums
$var = str_replace(array("\r\n","\n"),'<br>', $var);
echo str_replace("<br>", " ", $mystringwithbrs);