Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Escape sequences are used within strings to denote special meaning. begin with the escaping character backslash (\) and are used to signify that the character after the escape character should be treated specially. There are two types of escape sequences. Both begin with the escaping character backslash (\), and are distinguished based on the proceeding character.
Documentation
Escape Sequences begin with the escaping character backslash () and are used to signify that the character after the escape character should be treated specially. There are two types of escape sequences, distinguished based on the character following the escape character "backslash".
If the backslash is followed by an alphanumeric character, the entire escape sequence, including the backslash, is given a meaning. For example: \n will give you a new line, and \t will give you a tab.
If the backslash is followed by a special character, then the character following the backslash is parsed as it is in that location. This is the one we'll be using to show a dollar sign or a quote. Let's jump into workspaces and see how this affects our string.
Escaped Characters: if the string is enclosed in double-quotes ("), PHP will interpret more escape sequences for special characters:
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up