Re: Another preg question
| From: | Matt Matijevich | Date: | Fri, 13 Feb 2004 19:37:31 +0000 |
| Subject: | Re: Another preg question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177633@lists.php.net to get a copy of this message | ||
<snip>
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.
</snip>
not 100% sure this is right but give it a try
$text = preg_replace("/\n\n+|\n\r[\n\r]+|\r\r+/", "\n\n", $text);