I have something like this
$var = <<<HEREDOC
..."request": ${"hello"}...
HEREDOC;
Of course PHP thinks ${"hello"}
is a variable and it fails to load.
How to escape the $?
I have something like this
$var = <<<HEREDOC
..."request": ${"hello"}...
HEREDOC;
Of course PHP thinks ${"hello"}
is a variable and it fails to load.
How to escape the $?
The same way you escape almost anything in a string
$var = <<<HEREDOC
..."request": \${"hello"}...
HEREDOC;
echo $var;
RESULT
..."request": ${"hello"}...