I'm trying to clean up newline code received from a browser textarea.

First, I'm normalizing the newline codes to Unix with:

$text= preg_replace("/(\r\n|\r)/", "\n", $text); //this seems to work OK

Next, I want to remove excessive CR/LF, [i.e. more than 2]

$text= preg_replace("/\n\n+/", "\n\n", $text); // remove excess This doesn't seem to do anything.

Thanks.....

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to