callico wrote:brad's soultion worked for me but I'm curious about the '/n' for the replacement.
That's me typing too fast and watching TV at the same time. It should be "\n" (in double quotes).
Also, would I need an asterik rather than a ? to remove all \r\n occurances?
The ? is just applied to the '\n', so that each each occurence of '\r\n' or just '\r' if there's not trailing '\n' will be converted to a single '\n'. So 'blah\r\nblah\rblah\r\n\r\nblah" would become 'blah\nblah\nblah\n\nblah'. If you want to reduce multiple line breaks to single line breaks, then use:
$text = preg_replace('/(\r\n?)+/', "\n", $text);
Assuming I didn't make any other typos, of course. 😉