|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11075 bad operation of nl2br function
Submitted: 2001-05-24 02:55 UTC Modified: 2001-05-24 03:51 UTC
From: jkkim at mail dot naver dot com Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.5 OS: Linux6.2
Private report: No CVE-ID: None
 [2001-05-24 02:55 UTC] jkkim at mail dot naver dot com
nl2br function seems do not operate correctly.
For example,
$a = "aaa
$b = nl2br ($a);

The correct value of $b is following:

But I got the wrong value like this:
<br />

FYI, I have used PHP language for 2 years and 
the same code I tried worked well at the prior versions (PHP3.x, PHP4.0 ~ PHP4.0.4)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-24 03:43 UTC]
Please read the most recent manual entry (for 4.0.5).

   nl2br -- Inserts HTML line breaks before all newlines in a string


   string nl2br (string string)

   Returns string with '<br />' inserted before all newlines.

This is to support the latest HTML recommendation (XHTML 1.0)
 [2001-05-24 03:50 UTC]
As below.
 [2001-05-24 03:51 UTC]
Argh. Keep forgetting to close!
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Feb 24 06:01:29 2024 UTC