Since I haven't had any problems with <br /> I really don't care. However,
if you are concerned why don't you write a function like this:

my_nl2br($targetStr, XML = true) {
$buffer = '';
    if (XML) {
        return nl2br($targetStr);
    }
    else {
        $buffer = nl2br($targetStr);
        $buffer = str_replace ('<br />', '<br>', $buffer );
        return $buffer
    }
}


You might be able to call the function nl2br but I am sure you will get  a
function name class or "function re-declartion error", but if you are doing
some OOP then you may be able to overide that.

Maybe this is not the post you were looking for, anyways my 2 cents.

Bobby

"Raymond C. Rodgers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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