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); ------------------------ 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/
