尝试输出以下5但不确定如何操作。有任何想法吗?
<?php
$other='What are you like?';
$content['my_name']=4;
$str=<<<JT
here is some info. $other Do
you like the number {$content['my_name']+1} ?
JT;
echo $str . '<br />';
答案 0 :(得分:3)
正如佩卡所说:
$str=<<<JT
here is some info. $other Do
you like the number {$content['my_name']+1} ?
JT;
无效 - 只在heredoc中解析变量..
$content['my_name'] += 1;
$str=<<<JT
here is some info. $other Do
you like the number {$content['my_name']} ?
JT;