That almost works. The two \n in a row are on new lines.
So it's
\n
\n
intead of \n\n. If that makes any sense.
Jeff Oien
> Or you could just do this:
>
> <?php
> $str = "abc\ndefg\n\nxyzpqr\njklmno";
> $str = ereg_replace("([^\n])\n([^\n])", "\\1 \\2", $str);
> echo $str;
> ?>
>
> That should give you:
>
> abc defg\n\nxyzpqr jklmno
>
> Works by replacing any \n with a space, as long as that \n is not next to
> another \n.
>
>
> Cheers
>
> Simon Garner
>
>
--
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]