Re: Extra spacing with <br> in HTML
| From: | Jason Stechschulte | Date: | Sun, 28 Jul 2002 02:53:37 +0000 |
| Subject: | Re: Extra spacing with <br> in HTML | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110023@lists.php.net to get a copy of this message | ||
On Sat, Jul 27, 2002 at 08:08:34PM -0400, Kevin Breit wrote:
> Lets say I have
>
> <ul>
> <li>Blar</li>
> </ul>
>
> ln2br() will crunch that and put out:
> <ul><br />
> <li>Blar</li><br />
> </ul><br />
>
> That creates a lot of white space when that HTML is rendered. How do I
> tell PHP not to put line breaks in a situation like that?
There might be an easier way, but you might just have to write your own
code for this. Something along the lines of: (completely untested)
<?php
$line = ereg_replace("(^li|^ul|^ol)>\n", "<br />\n", $line);
?>
--
Jason Stechschulte
stech@ypisco.com
http://www.ypisco.com
--
The brain is a wonderful organ; it starts working the moment you get up
in the morning, and does not stop until you get to school.