But, all Escape Sequences work with double-quotes. See the following Escape Sequences Section –

PHP Escape Sequences

Escape sequences are used to escape a character, during the string parsing, and It is also used to give special meaning to represent line breaks, tabs, etc.

\ The backslash is used to escape.

In the above, we have already discussed that you can only escape single quotes and backslash inside the single quotes. Here’s an example –

<?php
//using a backslash to escaping a single quote
echo 'Hi I\'m John Doe';
echo '<br>';
//using a backslash to escaping a backslash
echo '\\ this is a backslash';
echo '<br>';
echo 'Hi I\\\'m John Doe';
?>

Browser Output

Hi I’m John Doe
\ this is a backslash
Hi I\’m John Doe

In the above, we have already discussed that all escape sequences work with double-quotes. Here’s an example –

<?php
echo "\"Double Quotes\"";
echo "<pre>\$dollar sign \nThis is new line \n\tA new line with tab Space</pre>";
?>