Re: \n \t don't work!!!
| From: | Steve Buehler | Date: | Mon, 13 Oct 2003 12:58:41 +0000 |
| Subject: | Re: \n \t don't work!!! | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165972@lists.php.net to get a copy of this message | ||
If you want it to work with \n, then you will need to use the <pre></pre> tags. Otherwise you need to translate the \n's into <br> tags. \n is NOT an html tag so when you print them to the browser, it adds lines to the source, but as you might already know, a new line in the source of an html page does NOT give a new line in the output unless you use an html tag that would give the new line.
Steve
At 06:39 AM 10/13/2003, you wrote:
They do work but you will not see that in the rendered html page (in a browser). Have a look at the source of the produced page and you will see the linebreaks. The page source shows: ************************************ ************************************ I suppose your manual was not intending on making html pages, or it was a very lousy one. I do want to just make a html page. The following is my source code, and what I expect is to see the new lines when the \n appears, ok? ***************************************** <body> <?php echo ("this is the simplest, an SGML processing instruction\n"); echo "This spans multiple lines. The newlines will be output as well"; echo "This spans\nmultiple lines. The newlines will be\noutput as well."; ?> </body> </html> ****************************************** So, what's the problem here? cheers, feng -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- This message has been scanned for viruses and dangerous content by the MailScanner at ow4, and is believed to be clean.