Re: stripping newlines from a string

From: Date: Mon, 09 Jun 2003 07:05:55 +0000
Subject: Re: stripping newlines from a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150720@lists.php.net to get a copy of this message
On Mon, 9 Jun 2003, Charles Kline wrote: > Yes. Is weird. I thought this would work too, but for some reason it > was not removing them all. I wonder if re-saving the files with UNIX > linebreaks (or try DOS) would have any effect. Will report back. $str = str_replace (array("\r", "\n"), '', $str); Regards, Philip > > On Monday, June 9, 2003, at 02:24 AM, Joe Pemberton wrote: > > > http://www.php.net/str_replace > > > > $newstr = str_replace("\n", "", $oldstr); > > > > ----- Original Message ----- > > From: "Charles Kline" <ckline@rightcode.net> > > To: <php-general@lists.php.net> > > Sent: Sunday, June 08, 2003 10:44 PM > > Subject: [PHP] stripping newlines from a string > > > > > >> Hi all, > >> > >> How would i go about stripping all newlines from a string? > >> > >> Thanks, > >> Charles > >> > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#150720) next »