Re: [PHP-DEV] Bug #11611 Updated: nl2br() outputting invalid <br> tags From: Lenar Lõhmus (lenar <email protected>)
Date: 06/24/01

> > when the rest of your code is just generating HTML compliant output, not
> > XHTML.
> >
> > Ok, somebody can always use something like str_replace("\n", "<br>",
> > $text) to get the old functionality.
>
> What if the rest of your code is generating XHTML? It's better to assume
> the more strict syntax, especially considering that nobody has yet found (to
> my knowledge) a browser where <br /> doesn't work.
>
Yes, agree, but this change has happend not much time ago, and I think
it's one's responsibility to maintain the behavior what it used to
be. Even more if the old syntax was generating standard compliant code
(and HTML4 is a standard).

Still, we must evolve, so a syntax like
nl2br(string text [boolean html4]) would give the most up to date
behaviour of this function, giving somebody an option to get the old
behaviour when it's really neccessary.

And ... you don't know a browser where <br /> dowsn't work? But there
might be one ... one's own specific implementation where creator haven't
thought up possibility that "<br>" might be "<br />" one day. Since it is
not neccessary for HTML to recognize "/" in the end of single tag then we
can't really blame him.

lenar.

> Matt
>

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>