SyntaxFix
Write A Post
Hire A Developer
Questions
Something a bit more functional (easy to use anywhere):
function strip_carriage_returns($string) { return str_replace(array("\n\r", "\n", "\r"), '', $string); }
Using PHP_EOL as the search replacement parameter is also a good idea! Kudos.