Escape Sequences
Some characters cannot be typed, and yet you will almost certainly want to use some of them from time to time. For example, you might want to use an ASCII character for a new line, but you cannot type it. Instead, you need to use an escape sequence: \n. Similarly, you can print a carriage return character with \r. It is important to know both of these because, on the Windows platform, you need to use \r\n to get a new line. If you do not plan to run your scripts anywhere else, you need not worry about this.
Going back to the first script you wrote, recall that it printed 2010 because you added 10 + 10 and then 10 + 0. You can rewrite that using escape sequences, like this:
<?php $i = 10; $j = "10"; $k = "Hello, world"; echo ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access