replacing 1> crlfs

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
recieving mail from various mail clients ... some for some reason put
anything up to 4 or 5 carriage breaks in some parts of message ...
ie /n/n/n/n (sometimes spaces in between ie /n/n  /n/n)
  or /r/r/r/r
so I need to replace any repeated line breaks with just one line break

any ideas?

Re: replacing 1> crlfs

brendan wrote:
Quoted text here. Click to load it

It's actually \n\n\n\n or \r\r\r\r (notice the backslash).

Quoted text here. Click to load it

$msg = preg_replace("/[\r\n][\s]+/", "\r\n", $msg);


Site Timeline