[PHP] Re: Stupid question, sorry...

2003-02-06 Thread Mathieu Dumoulin
All single quotes around variables or escape characters are written out man!

it's as simple as that.

example you have a variable named $hey and you want to output $hey, you
can't it's gonna replace the content of that string with the value of $hey.

When you put stuff inside ' ' they are not escaped by the system

Mathiue Dumoulin

Chris Boget [EMAIL PROTECTED] a écrit dans le message de news:
021901c2cdf4$4a806d00$[EMAIL PROTECTED]
 Why is it that \n gets translated to a _new line_ when in
 double quotes whereas it's displayed as the literal when
 in single quotes?  I checked out the docs but couldn't
 come up with a definitive answer.  If someone could point
 me to the right page in the docs that explains this, I'd be
 ever so appreciative!

 thnx,
 Chris




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Stupid question, sorry...

2003-02-06 Thread Goetz Lohmann
Chris Boget schrieb:
 Why is it that \n gets translated to a _new line_ when in
 double quotes whereas it's displayed as the literal when
 in single quotes?  I checked out the docs but couldn't 
 come up with a definitive answer.  If someone could point
 me to the right page in the docs that explains this, I'd be
 ever so appreciative!
 
 thnx,
 Chris
 


all inside of  will be interpreted instead of things
between '' will be as is ... and as \n means New Line
it will do this. If you wish to print out a \n then you
have to write it like \\n.

This is true for all special characters like:
\n   - new line
\r   - carriage return
\t   - tab
\- escape sign for the special characters
\\   - backslash itself


-- 
 @  Goetz Lohmann, Germany   |   Web-Developer  Sys-Admin
\/  --
()  He's the fellow that people wonder what he does and
||  why the company needs him, until he goes on vacation.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php