在PHP中我可以说
$noun = "bird";
$adjective = "warm;
echo <<<EOT
The $noun is very $adjective
EOT;它将输出
这只鸟很暖和
有什么方法可以用函数来实现吗?
function getNoun() { return "bird"; }
function getAdjective() { return "warm"; }
echo <<<EOT
The getNoun() is very getAdjective()
EOT;和输出
这只鸟很暖和
https://stackoverflow.com/questions/8362576
复制相似问题