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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 17:01:28 2024 UTC