This page will show several uses of the escape slash in php.

Don looked at Katrina and said, "It's really hot outside."

Katrina smiled at Don and said, "That's why I'm not wearing a jacket, " and giggled at Don.

What the slash does is tell the PHP to ignore extra quotation marks and not run them as PHP and instead run them as part of the echo statement. Because of this, what Don says in the first sentence is surrounded by double quotes, and what Katrina says in the second sentence is surrounded by double quotes.If the escape slashes weren't put into the echo statement, then it would confuse the PHP and then the code wouldn't run properly.


The escape slash can also work with single quotes as shown in the sentence below:

Don wondered what the meaning of 'life' was.

Just like when using the esape slash with double quotes, the escape slashes in the sentence above tell the PHP to ignore the extra single quotes in the echo statement and not run them as PHP, and instead show them as part of the sentence.