In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("David Balatero") wrote:
> So, I guess i need a regexp to remove all the
> \n and :space: chars.
Here are some ideas:
$out=preg_replace("/\s+/","",$in); //strip whitespace
or
$out=preg_replace("/\s+/"," ",$in); //replace whitespace with single space
Note that you requested is different from your example, in which it looks
like you are simply condensing multiple newlines down into a single
newline. For that, something like this might be more appropriate:
$out=preg_replace("/(\n|\r|\r\n)+/","\n",$in);
Play around with 'em. <g>
--
CC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]