Thanks Ian,
That should do the trick nicely.
Now why didn't I think of that (don't answer).
- Original Message -
From: "Ian Bambury" <[EMAIL PROTECTED]>
To:
Sent: Friday, December 02, 2005 10:35 AM
Subject: Re: [php-list] Removing newline
> Change \n\n to
ot;\n\n"
> intact.
> Unusual request, but it's for a text formatter.
>
>
> - Original Message -
> From: "Patrick Bierans" <[EMAIL PROTECTED]>
> To:
> Sent: Thursday, December 01, 2005 7:08 PM
> Subject: Re: [php-list] Removing newline
>
<[EMAIL PROTECTED]>
To:
Sent: Thursday, December 01, 2005 7:08 PM
Subject: Re: [php-list] Removing newline
> try this:
>
> $str=str_replace("\r","",$str);
> $str=preg_replace("/\n([^n]+)/","$1",$str);
Yahoo! Group
try this:
$str=str_replace("\r","",$str);
$str=preg_replace("/\n([^n]+)/","$1",$str);
Yahoo! Groups Sponsor ~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/HKFolB/TM
--
How can I remove "\n" from a text string, but without removing "\n\n", using
preg_replace?
Just can't get it to work.
I'd prefer to use preg_replace(); instead of ereg_replace(); as that's what
I've been concentrating on.
Thanks.
Yahoo! Groups Sponsor