php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9542 \n not forcing a new line.
Submitted: 2001-03-04 02:25 UTC Modified: 2004-04-09 19:27 UTC
From: davidlbarber at home dot comEch Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.4pl1 OS: Corel Linux 1.1.2
Private report: No CVE-ID:
 [2001-03-04 02:25 UTC] davidlbarber at home dot comEch
<?php		echo "Some String \n"
		echo "Some more String \n"
					?>
I expected this output:

Some String
Some more String

But I'm getting this output:

Some StringSome more String

No new line is being forced. The problem also occurs with PRINT
 as well as ECHO.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-04 12:10 UTC] cynic@php.net
are you looking at it in a browser? if so, look at the source of the page. the newline is there. if not, reopen the report.
 [2004-04-09 16:23 UTC] cperrywebrat at yahoo dot com
I also do not get a new line using this:
<?php
     echo('<BR>Number of \r\nrecords f\rou\nnd: '.$counter);
?>

Yes, I am looking at this in a browser.  Is there maybe a configuration setting not allowing this?
 [2004-04-09 19:27 UTC] tomsommer@php.net
cperrywebrat at yahoo dot com:

Read the documentation, http://php.net/manual/en/language.types.string.php

Not a bug.
Please don't comment on old and closed bugs, create a new one - after doublechecking the manual
 [2011-02-12 19:56 UTC] dwurry at gmail dot com
To print a newline in the browser ad a <p> tag to create a new paragraph.  Like 
this:   

echo ("<p>The sql is: ".$sql);

You can close it too if you like....  echo("</p>");
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 10:02:09 2014 UTC