regex for multiple line breakes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

I am trying to remove multiple linebreakes from a textarea input. Spammers tend to insert multiple line breakes. The problem is, that I want to allow 2 line breaks so basic formating should be allowed.

I am doing this by regex:
$data[txt] = preg_replace('`[\r\n]+`',"\n",$data[txt]);

I would need a regex that allows \r\n\r\n, but not more than this.

Thank you for any help,

Merlin

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux