【发布时间】:2020-12-01 17:57:31
【问题描述】:
我将 heredoc 存储在 MySQL 文本类型中。
Hi, $candidate.
This is $interviewer speaking.
我想像下面这样动态地使用heredoc。 (“$mailTemplate->body”是上面 MySQL 文本类型的字符串。)
$candidate = 'CANDIDATE';
$interviewer = 'INTERVIEWER';
$mailBody = <<< EOM
$mailTemplate->body
EOM;
但是 heredoc 不起作用,变量按原样输出。
Hi, $candidate. This is $interviewer speaking.
有什么想法吗?还是不可能?
谢谢。
【问题讨论】: