On 25 Feb 2005 15:25:17 -0800,
revjjjames@hotmail.com wrote:
>What is the correct expression to remove any extra line breaks beyond
>two in a string?
There any may ways but I'd probably use something like:
$string = preg_replace('/(?<=\n)(\n?)\n*/s', "$1", $string);
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool