Re: New to PHP question

From: Date: Wed, 28 Jan 2009 19:21:40 +0000
Subject: Re: New to PHP question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-287289@lists.php.net to get a copy of this message
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. Stephen

« previous php.general (#287289) next »