Re: newline in string

From: Date: Sun, 13 Oct 2002 16:41:41 +0000
Subject: Re: newline in string
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-119793@lists.php.net to get a copy of this message
Thanks everyone. I'' be breaking the string after the newline so that I can convert the html to php echos and write them to a file. -Shawn "John W. Holmes" <holmes072000@charter.net> wrote in message news:000d01c272c1$544444d0$7c02a8c0@coconut... > > I have loaded an html file into a string. How can I search the string > for > > newlines/linefeeds? I know they are there, because if I echo the > string > > and > > view source in the browser, some tags are on new lines. > > > > Example: > > <html> > > > > <head> > > </head> > > And do what when you find them? If you just want to know if there are > newlines in the file, then use strstr(). If you want to remove or > replace them, then use str_replace(). If you want to add in a <br> where > some newlines are, then use nl2br(). > > ---John Holmes... > >

« previous php.general (#119793) next »