I’ve got a string like "foo\nbar", but depending on platform, that could become "foo\n\rbar", or whatever. I want to replace new lines with ", ". Is there a nice (php) regex that’ll do that for me?
I’ve got a string like foo\nbar , but depending on platform, that could become
Share
Try the regular expression
(?:\r\n|[\r\n]):