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
 [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 25 23:01:29 2024 UTC