note 69297 deleted from function.echo by betz
| From: | betz@php.net | Date: | Wed, 30 Aug 2006 16:39:40 +0000 |
| Subject: | note 69297 deleted from function.echo by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-116512@lists.php.net to get a copy of this message | ||
Note Submitter: Joey
----
The below example (taken from the help documentation) will not output multiple lines within the
context of a web-page. It will if you are running this command at the command prompt. Newlines are
treated as white-space in html browsers. The example is misleading because the code snippent is
provided within the context of <?php escape for an html page.
<?php
.
.
.
echo "This spans
multiple lines. The newlines will be
output as well";
.
.
.
?>
Use the nl2br() function when outputting strings to an html context if you want to retain newlines
in your output.