note 69297 added to function.echo

From: Date: Wed, 30 Aug 2006 15:27:13 +0000
Subject: note 69297 added to function.echo
Groups: php.notes 
Request: Send a blank email to php-notes+get-116510@lists.php.net to get a copy of this message
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. ---- Server IP: 64.71.164.2 Probable Submitter: 207.225.212.52 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.echo.php Edit -- https://master.php.net/note/edit/69297 Del: integrated -- https://master.php.net/note/delete/69297/integrated Del: useless -- https://master.php.net/note/delete/69297/useless Del: bad code -- https://master.php.net/note/delete/69297/bad+code Del: spam -- https://master.php.net/note/delete/69297/spam Del: non-english -- https://master.php.net/note/delete/69297/non-english Del: in docs -- https://master.php.net/note/delete/69297/in+docs Del: other reasons-- https://master.php.net/note/delete/69297 Reject -- https://master.php.net/note/reject/69297 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116510) next »