下面,我正在使用heredoc来创建电子邮件模板。我一直收到错误:
Parse error: syntax error, unexpected $end in C:\path_to_script.php on line 149
当我从php脚本中删除下面的代码时,我没有收到任何错误。我对使用heredoc很新,所以请原谅我的无知。
$body = <<<EOF
{$emailStyle}
<p>Hello. Your new client has completed registration.</p>
<p>An email has been automatically generated and fowarded to the client.</p>
<hr>
<p><strong>Client details:</strong></p>
<p>Name: {$name}</p>
<p>Company: {$company}</p>
<p>Phone: {$phone}</p>
<p>Email: {$email}</p>
<a href="{$csvLink}" target="_blank">Download CSV here</a>
<p>Code: {$code}</p>
<hr>
{$emailFooter}
EOF;