Escaping your code - Escaping double codes

Right up there with remembering to terminate your commands with semicolons ( ; ) is remembering to escape characters such as quotation marks. When you use quotation marks inside other quotation marks, the inner pairs must be delineated from the outside pair using the escape (\) character (also known as a backslash).
The following steps show you what happens when your code isn’t escaped and how to fix it.

1. Open a new file in your text editor.
2. Type the following HTML:

<TITLE>Escaping double codes</TITLE>
echo "<P>I think this is really \"cool\"!</P>";

No comments:

Post a Comment