Re: New to PHP question

From: Date: Wed, 28 Jan 2009 20:06:47 +0000
Subject: Re: New to PHP question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-287296@lists.php.net to get a copy of this message
2009/1/28 Stephen <stephen-d@rogers.com>: > Don Collier wrote: >> >> I am just learning PHP from the O'Reilly "Learning PHP 5" book and I have >> a question regarding the formatting of text. Actually it is a couple of >> questions. >> >> First, when I use the \n and run the script from the command line it works >> great. When I run the same code in a browser it does not put the newline in >> and the text runs together. I know that I can use <br/> to do the same >> thing, but why is it this way? >> >> The second question is closely related to the first. When formatting text >> using printf the padding works great when running from the command line but >> not at all when in a browser. >> Here is the code that I am working with: >> > Browsers **only** support HTML. > > They do not understand things like "\n" to be anything special, so they just > print as it is sent to the browser. <?php header('Content-Type: text/plain'); echo "That's\n"; echo "Not\n"; echo "Entirely\n"; echo "Accurate."; ?> -Stuart -- http://stut.net/

« previous php.general (#287296) next »