我将下面的代码嵌入到我的 php 标签中,但是它不读取 html,有人知道为什么吗?任何帮助,将不胜感激。
echo <<<_END
<pre>
<form action = "sqltest.php" method = "POST">
Author <input type = "text" name = "author" />
Title <input type = "text" name = "title" />
Category <input type = "text" name = "category" />
Year <input type = "text" name = "year" />
ISBN <input type = "text" name = "isbn" />
<input type = "submit" value = "Add Record" />
</form>
</pre>
_END;
Run Code Online (Sandbox Code Playgroud)
问题在于空格,使用 <<<_END 语句时要小心,因为默认文本编辑器可能会缩进它。不能有空格。