Windows, Mac and UNIX all have different ways of doing LF/CR:
Windows = \r\n
Mac = \r
UNIX = \n
I always convert everything to the UNIX standard before sticking in the database:
$text = str_replace("\r\n", "\n", $text);
$text = str_replace("\r", "\n", $text);