[eluser]TheFuzzy0ne[/eluser]
In a double-quoted string, a backslash is an escape character, you you need to type TWO backslashes in succession for it to render correctly.
Code:
echo "\\(backslash\\)";
Also, in double-quoted strings, variables are parsed, and since variables begin with a dollar sign, it needs to be escaped in order for it not to be parsed.
Code:
$str = 'Hello';
echo "$str" // Prints "Hello".
echo "\$str"; // Prints "$str".
By using single-quotes, variables won't be parsed, but you will still need to escape backslashes.
Code:
echo '\\$str\\'; // Prints "\$str\".
echo '\\\\$str\\\\'; // Prints "\\$str\\".