我当时正在使用Heredoc测试变量的简单赋值,但是当我尝试回显它时却什么也没显示
<?php
$varable = <<<LINES
1st line
2nd line
LINES;
echo "<script>alert(\"$varable\")</script>";
?>
但是当我尝试只用1行运行它时,它就可以正常工作:
<?php
$varable = <<<LINES
1st line
LINES;
echo "<script>alert(\"$varable\")</script>";
?>