Hi All,
The heredoc syntax enables to put some text in a variable for future reuse. For example :
$my_var = <<<EOD The colour is red. EOD; echo $my_var;
will result in "The colour is red". So far so good. Now let's assume the following:
$colour="red"; $my_var = <<<EOD echo 'The colour is '.$colour; EOD; echo $my_var;
Unfortunately the result will be "echo 'The colour is '.red;".
In this situation, is there a way to tell php to just put "The colour is red" into the $my_var variable ? Or is there an alternative to heredoc ?
Thanks!