Page 1 of 1

escape sequences don't work

Posted: Wed Jul 31, 2002 10:53 am
by andrec
hi all,


I have searched on this forum as well as tested it on both WIN32 and FreeBSD environment. I still don't know why a script as simple as the following has problem with the escape sequences. I tried also \t\r...etc and they just don't work as they are supposed to. I'd appreciate any help.

<?php
echo ("test\n");
echo ("test2");
?>

Posted: Wed Jul 31, 2002 11:04 am
by llimllib
If you view your source, it probably worked. if you see:

Code: Select all

test
test2
then it did exactly what it was supposed to. If you want the browser to display a line break, then you can do:

Code: Select all

echo "test<br>";
echo "test2";

Posted: Wed Jul 31, 2002 11:15 am
by andrec
If the escape sequences are only shown when you view source via your browser instead of interpreted by the browser naturally and displayed , I am curious what they are for.

Posted: Wed Jul 31, 2002 11:41 am
by volka
browsers are not everything.
And when you put a newline in a normal .html file it also doesn't show up.

Posted: Wed Jul 31, 2002 12:10 pm
by twigletmac
andrec wrote:If the escape sequences are only shown when you view source via your browser instead of interpreted by the browser naturally and displayed , I am curious what they are for.
Have you ever tried to debug HTML that's all on one line? It's a nightmare.

Mac

Posted: Wed Jul 31, 2002 12:31 pm
by andrec
I got the idea now. Thank you for all the replies.

Posted: Wed Jul 31, 2002 1:00 pm
by cheatboy00
twigletmac wrote:
andrec wrote:Have you ever tried to debug HTML that's all on one line? It's a nightmare.

Mac
acutally i ahve and i do ... its fun!!!! :D :D :D

Posted: Wed Jul 31, 2002 4:00 pm
by twigletmac
Each to their own... :roll:

Mac