You are here: Re: [PHP] formatting paragraphs in to strings « PHP « IT news, forums, messages
Re: [PHP] formatting paragraphs in to strings

Posted by John Browne on 06/13/05 23:52

Right.. But the browser also should be ignoring the carriage returns
as well, which makes me think the div is set to "white-space: pre;" or
something. He said the text is being formatted in a div exactly how
it is entered into the system. By default, a div does not render any
carriage returns.


On 6/13/05, Murray @ PlanetThoughtful <lists@planetthoughtful.org> wrote:
> > Good point. Only problem is, if someone hit enter a-million times,
> > you would end up with a-million spaces where the "\n" characters were.
> > To take care of that repetition, maybe something like:
> >
> >
> > while (strpos($textarea_text, "\n\n")) {
> > .....
> > }
> >
> >
> > would be one way you could do it.
>
> Ordinarily most browsers render multiple consecutive spaces as a single
> space. This doesn't mean that it's not a good idea to remove them, just that
> not doing so shouldn't effect the way the text is displayed in the div tag,
> as the original poster mentioned was his intention.
>
> Regards,
>
> Murray
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация