Re: Extra spacing with <br> in HTML

From: Date: Sun, 28 Jul 2002 14:23:55 +0000
Subject: Re: Extra spacing with <br> in HTML
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-110052@lists.php.net to get a copy of this message
On Sun, 2002-07-28 at 10:14, Justin French wrote: > on 29/07/02 12:02 AM, Kevin Breit (mrproper@ximian.com) wrote: > > >> Aaaannny way, you can't modify WHAT php does in nl2br, but you can do > >> something to the resulting code, like replacing "</li><br />" > >> with "</li>": > >> > >> <? > >> $original = "<ul><li>Blar</li></ul>"; > >> $new = nl2br($original); > >> $new = str_replace('</li><br />', '</li>', > >> $new); > >> ?> > > > > Hmmm..you've got it backwards, but I see what you mean. I'll tool > > around with it tonight. > > I don't think I did.... > > Manual Quote: > > Description > mixed str_replace ( mixed search, mixed replace, mixed subject) > > So, we search for </li><br /> (the problem being the unnecessary <br />, and > replace it with </li>. > > Unless I'm misunderstanding the question/problem. Oh wait, you're right! Kevin -- Kevin Breit <mrproper@ximian.com>

« previous php.general (#110052) next »