Change \n\n to [holder]
Change \n to null string
Change [holder] to \n\n

On 01/12/05, Bob <[EMAIL PROTECTED]> wrote:
>
> Thanks Patrick,
> worked as I asked, but worded my question wrong :-)
>
> I'd like to remove all the single "\n", but leave any double "\n\n"
> intact.
> Unusual request, but it's for a text formatter.
>
>
> ----- Original Message -----
> From: "Patrick Bierans" <[EMAIL PROTECTED]>
> To: <[email protected]>
> 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);
>
>
>
>
> Community email addresses:
> Post message: [email protected]
> Subscribe:    [EMAIL PROTECTED]
> Unsubscribe:  [EMAIL PROTECTED]
> List owner:   [EMAIL PROTECTED]
>
> Shortcut URL to this page:
> http://groups.yahoo.com/group/php-list
> Yahoo! Groups Links
>
>
>
>
>
>
>


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to