What are the differences between using " and ' in PHP string declarations?

In PHP, using double quotes (") allows for the interpolation of variables within the string, while single quotes (') treat everything as a literal string. Double quotes also interpret escape sequences like \n or \t, while single quotes do not. When using double quotes, PHP will evaluate variables and special characters within the string, whereas single quotes will treat everything as plain text.

$name = "John";
echo "Hello, $name!"; // Output: Hello, John!

$name = "John";
echo 'Hello, $name!'; // Output: Hello, $name!