Skip to content

Instantly share code, notes, and snippets.

@wilhelm-murdoch
Created March 11, 2010 01:50
Show Gist options
  • Save wilhelm-murdoch/328711 to your computer and use it in GitHub Desktop.
Save wilhelm-murdoch/328711 to your computer and use it in GitHub Desktop.
/**
* Completely strips a string of carriage returns and line feeds.
*
* @param $string String to parse
* @return String
*/
function stripReturns($string)
{
return str_replace(array("\r\n", "\r", "\n"), array("\n", "\n", ''), $string);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment