php.net |  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
bbb";
$b = nl2br ($a);

The correct value of $b is following:
"aaa<br>
bbb"

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

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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

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

Description

   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] swm@php.net
As below.
 [2001-05-24 03:51 UTC] swm@php.net
Argh. Keep forgetting to close!
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Feb 21 16:01:27 2020 UTC