note 100109 deleted from language.types.string by salathe
| From: | salathe@php.net | Date: | Sun, 01 May 2011 09:59:54 +0000 |
| Subject: | note 100109 deleted from language.types.string by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179318@lists.php.net to get a copy of this message | ||
Note Submitter: realdreams
----
About Escaped characters in double quotes:
/n
code:
echo "a\nbcd";
in browser:
a bcd
browser source code:
a
bcd
/r
code:
echo "a\rbcd";
in browser:
a bcd
browser source code:
a
bcd
/r
code:
echo "a\rbcd";
in browser:
a bcd
browser source code:
abcd
(but if I copy&paste if to a text editor, it appears as
a
bcd)
/t
code:
echo "a\tbcd";
in browser:
a bcd
browser source code:
a bcd
I don't fully understand how the browser or html handles these escaped characters. It seems to
me that in html output /n /r /t is a single space.
-----------------------------------------------------------
In double quotes, the space between variable and other characters/variables are ignored.
How can I keep the space when there's a variable in double quotes?