Interpolate a constant (not variable) into 'heredoc'

后端 未结 6 1779
梦谈多话
梦谈多话 2020-12-29 01:47

Consider:

The value of my_const is {my_const}.

MYECHO; ?>
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-29 01:59

    Put your defined variable into simple variable and use include it in heredoc just as in following example:

    The value of my_const is {$variable}.

    MYECHO; ?>

提交回复
热议问题