I am getting this syntax error while using heredoc in php.
Unexpected: << after: =
Can somebody help me with this?
I am getting this syntax error while using heredoc in php.
Unexpected: << after: =
Can somebody help me with this?
Problem not with <<<END_OF_BLOCK
but with END_OF_BLOCK;
you must not use whitespaces before END_OF_BLOCK;
.
Here example:
<?php
$message = 'Hello World';
$variable = <<<EOT
echo "{$message}";
EOT;