PHP Escape Slash Examples

Example WITH escape slash

She said, "PHP is fun to learn!"

Example WITHOUT escape slash

PHP is fun to learn without any quotes inside!

Explanation

In PHP, a backslash treats the next character as a normal text, not a special one. The first example needed it because it had quotation marks inside a double quoted string. With no special characters to protect the second one didn't need one.