I'm sure that this has probably been discussed before, but I couldn't
seem to find any direct references to such a discussion. The line break
tags that nl2br() produces have the forward slash embedded in them,
which is not in the HTML 4.x standard. While this isn't a big deal
really, the fact of the matter is that web browsers built to the
specifications of the W3C HTML 4.x standards may not like this. In fact
the W3C HTML validator reports this as an error.

I read on the function description page that this is apparently an XHTML
curiosity. Would it be possible for someone to add an optional flag to
nl2br() to specify HTML rather than XHTML compliance? For instance, a
call to nl2br() without XHTML compliance might look like this:

        $mystring=nl2br($myotherstring,false);

For compatibility's sake, maybe default the flag to true and make the
flag optional. If unspecified, the call to nl2br() would continue to
function as it always has. However if specified, and set to false, the
function would return the HTML compliant break tag <br>.

Thoughts? Comments?
-- 
Raymond C. Rodgers
http://bbnk.dhs.org/~rrodgers/
http://www.j-a-n.net/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to