What is the function, where it takes a string lets say it looks like
Blah Blah Blah Blah Blah Blah Etc, etc, etcs.
Blah Blah Blah
Etc, etc, etcs.
And make it all on one line, so it would look something like
Awfully vague, but are you saying you want to remove newline characters? [man]str_replace[/man]
I am trying to get everything in the string in one line, instread of scattered everywhere and yes I already tried that str_replace by replacing \r with nothing.
Originally posted by Napster I am trying to get everything in the string in one line, instread of scattered everywhere and yes I already tried that str_replace by replacing \r with nothing.
The newline character is \n.
to cover UNIX, Windows and Mac LF/CR characters:
$string = str_replace("\r\n", '', $string); $string = str_replace("\r", '', $string); $string = str_replace("\n", '', $string);
Originally posted by devinemke to cover UNIX, Windows and Mac LF/CR characters: $string = str_replace("\r\n", '', $string); $string = str_replace("\r", '', $string); $string = str_replace("\n", '', $string); [/B]
Originally posted by devinemke to cover UNIX, Windows and Mac LF/CR characters:
[/B]
Although the first one isn't necessary (it's handled by the other two!) 🙂