"Amit Varia" <sp**@amitvaria.com> wrote in message
news:bu**********@geraldo.cc.utexas.edu...
How would you remove newline characters from a string?
I tried
str_replace("\n", "", $string);
But that doesn't work.
as was posted there is also the \r on some files or \r\n, try this:
// for end of line (or begining)
$string = trim($string);
// from everywhere
$string = str_replace("\n", "", $string);
$string = str_replace("\r", "", $string);
--
Mike Bradley
http://www.gzentools.com -- free online php tools