<?php
echo <<< HTML
<form action="process.php" method="post">
<input type ="submit" value="通过">
输入拒绝信息:<input type="text" name="refuseinformation">
<input type ="submit" value="拒绝">
</form>
HTML;
?>
与
<?php
echo <<< HTML
<form action="process.php" method="post">
<input type ="submit" value="通过">
输入拒绝信息:<input type="text" name="refuseinformation">
<input type ="submit" value="拒绝">
</form>
HTML;
后者将会报错,
原因:当HEREDOC在PHP最后时,PHP的闭合标签不能隐藏。否则会报错。