|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11611 nl2br() outputting invalid <br> tags
Submitted: 2001-06-21 22:13 UTC Modified: 2004-10-13 22:40 UTC
From: nutbar at chemlab dot org Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.0.5 OS: Linux Slackware current 2.4.5
Private report: No CVE-ID: None
 [2001-06-21 22:13 UTC] nutbar at chemlab dot org
put this into a test php file:

	$temp = "this is\n\na test\n";
	printf("%s", nl2br($temp));

and you should get this as output from your webserver:

this is<br />
<br />
a test<br />

I have confirmed this to be also an issue in the 4.0.6 release candidates, but I do not know when this all of a sudden became an issue.  I'd like to know why it's creating <br /> tags instead of <br> tags :)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-22 04:39 UTC]
It's XHTML compliant
 [2001-06-22 09:07 UTC]
Could this be even more bogus? :)

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 21 08:01:34 2024 UTC