Re: \n \t don't work!!!

From: Date: Mon, 13 Oct 2003 13:00:12 +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-165974@lists.php.net to get a copy of this message
Do what I do, use both the \n and the <br> tags. I am not worried about anybody else thinking the source is nice looking, I do it for debugging so that I can see how the source comes out in a readable format. Steve At 06:48 AM 10/13/2003, you wrote:
Ok, Now I see what happen (maybe). So, the "\n" is not for the browser output, but for the *view source*? So, it's different from the "echo <br>"? If so, what's the deal to do that? --- Makes it look nice if the user view the source code? cheers, feng ----- Original Message ----- From: "Chris Hayes" <chayes@antenna.nl> To: "Wang Feng" <u3926286@anu.edu.au>; <php-general@lists.php.net> Sent: Monday, October 13, 2003 9:29 PM Subject: Re: [PHP] \n \t don't work!!! At 13:22 13-10-03, you wrote:
Guys, These codes are copied from the manual: ***************************************************** 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.";
****************************************************** None of them works.
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. I suppose your manual was not intending on making html pages, or it was a very lousy one. I would recommend reading the first chapters of the manual on www.php.net to get a general idea of PHP. Then read some tutorials on for instance phpfreaks.com.
I mean there're not any new lines generated in my browser and I have to use the echo"<br>" to print a new line. But why doesn't the \n work? BTW, the \t doesn't work either. (WindowsXP Pro + PHP Version 4.1.1) Please advise. cheers, feng -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- 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.


« previous php.general (#165974) next »