you also need to remove \r from the string.
(on windows, newline is \r\n, on *nix it's just \n, but a windows client
will send \r\n, and on older macs I think newline was just \r but I can't
remember for sure.)
"Amit Varia" <spam@amitvaria .com> wrote in message
news:buvh93$595 $1@geraldo.cc.u texas.edu...[color=blue]
> How would you remove newline characters from a string?
>
> I tried
>
> str_replace("\n ", "", $string);
>
> But that doesn't work.
>
>
>[/color]
"Amit Varia" <spam@amitvaria .com> wrote in message
news:buvh93$595 $1@geraldo.cc.u texas.edu...[color=blue]
> How would you remove newline characters from a string?
>
> I tried
>
> str_replace("\n ", "", $string);
>
> But that doesn't work.
>
>
>[/color]
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);
Comment