0
我有它建立了我的大部分应用头的功能:新线,但保持现有的线压痕
function header() {
$html = "<title>Test</title>\r\n";
$html .= "<link rel='stylesheet' href='main.css'>\r\n";
return $html;
}
现在这个伟大的工程,但无论哪种所有的内容都在1线(如果删除\ r \ n)或者它们落在下一个新行中(如预期的那样),但它会损失缩进。
有没有办法让我保留前面的行缩进?这纯粹只是为了演示起见(没有所需的功能)
看看[定界符](HTTP:// WWW .php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) –
[This question](http://stackoverflow.com/questions/5116599/tidying-html-5 -output-indentation-in-php)基本上询问了它看起来像的东西。接受的答案提到了[PHP Tidy扩展](http://www.php.net/manual/en/book.tidy.php),您可能会发现它很有用。 – ajp15243