heredoc { } :
$htmlcode=<<<eod
<div>{$question}</div>
<div>{$option1} {$option2} {$option3} {$option4}</div><br/>
eod;
echo $htmlcode;
The problem is that PHP is suffocating from the fact that you have no spaces separating the variables $questionand $option4from opening <to your closing tags div.
Also, make sure that eodthere is no space after the semicolon following the separator . The only thing allowed on this line is your separator and semicolon, if necessary.
source
share