You have a number of options right in php. For example:
$f=file_get_contents("files/uploads/$fileName");
$f=str_replace("\r","",$f);
file_put_contents("files/uploads/$filename",$f);
This will strip all RETURN characters ("\r") from the input and write the file back with just linefeeds ("\n").
I have yet to see a CSV/Spreadsheet file with just "\r" characters, but supposing that is the case you could also do: str_replace("\r","\n") and then reduce "\n\n" to a single "\n" (again using str_replace).
There is also a REGEX-based solution, but the regex-part of my brain is a little fried this morning.