php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12762 nl2br -- Converts newlines to HTML line breaks
Submitted: 2001-08-15 07:25 UTC Modified: 2001-08-15 07:30 UTC
From: dorogov at zmail dot ru Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dorogov at zmail dot ru
New email:
PHP Version: OS:

 

 [2001-08-15 07:25 UTC] dorogov at zmail dot ru
<?
$test = fopen("test1.txt", "r") or die("unable to open file");
 while (!feof($test))
 {
 $line = fgets($test, 1024);
 $line = nl2br($line);
 print $line; 
 } 
?>
contents of file test1.txt:
test
test
test

In HTML:
test<br />
test<br />
test<br />

That is to say <br /> instead of <br>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-15 07:30 UTC] sniper@php.net
This is intended. Search the bug db for better explanation..and read the bugs-dos-and-donts next time
BEFORE submitting bug reports.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 20:01:46 2025 UTC