Bug #63427 [Com]: echo or print don t print spaces and new lines
| From: | rbrunius at gmail dot com | Date: | Tue, 06 Nov 2012 06:01:49 +0000 |
| Subject: | Bug #63427 [Com]: echo or print don t print spaces and new lines | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9066@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63427&edit=1
ID: 63427
Comment by: rbrunius at gmail dot com
Reported by: abelahcene at gmail dot com
Summary: echo or print don t print spaces and new lines
Status: Open
Type: Bug
Package: Online Doc Editor problem
Operating System: linux debian
PHP Version: 5.4Git-2012-11-03 (Git)
Block user comment: N
Private report: N
New Comment:
Are you looking at the output with a web browser? If so the "\n" does not cause a
line break. You need a "<br />".
Previous Comments:
------------------------------------------------------------------------
[2012-11-04 02:15:01] niel dot archer at gmail dot com
Works fine for me using v5.3.13, what version are you using.
Be sure you are using double-quotes, not single-quotes, or the line-feeds will not
work.
------------------------------------------------------------------------
[2012-11-03 12:50:00] abelahcene at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.echo#refsect1-function.echo-description
---
echo or print don t print spaces and new lines
so echo "hello \n world \n hello again"
is printed in the same line.
same problem with print.
Test script:
---------------
<?php
echo "hello \n world \n hello again"
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63427&edit=1