|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10707 nl2br gives <br /\n>
Submitted: 2001-05-07 11:27 UTC Modified: 2001-05-07 12:29 UTC
From: al at humantouch dot de Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.5 OS: RedHat 7.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
11 - 9 = ?
Subscribe to this entry?

 [2001-05-07 11:27 UTC] al at humantouch dot de
It seems that nl2br() returns <br/\n>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-07 12:29 UTC]
What it's actually outputting is "<br />\n"

<? $str = "One\nTwo"; echo nl2br($str); ?>


One<br />

This is consistent with its old behavior, which was to output "<br>\n"

While it might not strictly be the expected behavior, this seems fine to me.  The newline won't affect how a browser renders the string, since it's just whitespace to be ignored.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 14:01:27 2024 UTC