PHP Escape Slash

Without escape slash: My name is Sharmin and I said "Hello".

Using escape slash: My name is Sharmin and I said "Hello".

Explanation

The escape slash, or backslash, tells PHP to treat a special character as part of the text instead of interpreting it as PHP syntax. In the second example, the backslashes allow double quotation marks to appear inside a double-quoted PHP string without ending the string early.

Back to Activity 3