|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16213 Ignores Escape Codes
Submitted: 2002-03-21 17:03 UTC Modified: 2002-03-21 17:43 UTC
From: ht_regz at shaw dot ca Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.1.1 OS: Windows XP Pro
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.
Block user comment
Status: Assign to:
Bug Type:
From: ht_regz at shaw dot ca
New email:
PHP Version: OS:


 [2002-03-21 17:03 UTC] ht_regz at shaw dot ca
To quote the manual's example

echo "This spans
multiple lines. The newlines will be 
output as well";

echo "This spans\nmultiple lines. The newlines will be\noutput as well.";

simply does not work... 
When escape codes are entered it shows up exactly as written minus the escape codes.
if i were to
echo "Line 1";
echo "Line 2";
the output on the page would be Line 1Line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-21 17:07 UTC]
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit
 [2002-03-21 17:07 UTC]
This functionality work fine..

your example
echo "Line 1";
echo "Line 2";

should print Line 1Line 2

if you want to do something like this
echo "Line 1\nLine 2\n";
echo "Line 1

- Brad
 [2002-03-21 17:33 UTC] ht_regz at shaw dot ca
ok I apologize for that... the internet connection here at work has been intermittant and I wanted to get it up as fast as possible... the 
echo "Line 1";
echo "Line 2";
should of shown
echo "Line 1\n";
echo "Line 2\n";
and it still prints Line 1Line 2

as for
I don't see how this is a support question.. it's a bug somewhere between php & apache for win, because the same page of code works fine when ran on php & apache in Mandrake.
 [2002-03-21 17:36 UTC]
It is a support question because it is an HTML 101 question that most people new to this stuff asks at some point.  Newlines mean nothing in HTML unless you are inside a <pre> </pre> block.  Do a "view source" and you will see your newlines.  If you want an actual newline in the HTML rendering you need to output <br />  This is not, has never been, and will never be a PHP bug.
 [2002-03-21 17:36 UTC]
I see what you are doing..
It's still not a bug...

You are viewing this in a web browser correct?

You are printing hard returns not <br>'s
echo "Line 1<br>";
echo "Line 2<br>";

the other way if you "view source" you would see the
Lines on different lines...

So this bug is still bogus.
 [2002-03-21 17:40 UTC] ht_regz at shaw dot ca
Well your the experts so I'll take your word for it and apologize for posting here, but i'd also like to point out that 
echo "Line 1<br>";
echo "Line 2<br>";
doesn't work either, when I do that I would see
Line 1<br>Line 2<br>
 [2002-03-21 17:43 UTC]
If that's the case, then either your browser is absolutely braindead, or for some reason you are not sending text/html typed responses.  You are using XP, so it is pretty hard to guess which of the thousands of ways you have to screw up you decided to use.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Mar 26 00:03:53 2023 UTC