簡體   English   中英

如何在content-type中添加新的換行符:php生成的text / plain文檔?

[英]How to add new line break in content-type : text/plain document generated by php?

我想在文本文件中添加鏈接中斷。 我怎么做?

我的代碼如下。

<?php 
header('Content-Type: text/plain');
?>
Line 1
Line 2
Line 2

我嘗試了以下。

1. echo 'Line'."\n\r"
2. echo nl2br('Line'."\n\r")
3. echo 'Line' . PHP_EOL
4. echo 'Line' . "<br/>"

什么都沒用。

\\n用於當內容類型為text/plain時換行

<br>當content-type為text/html時換行

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM