[英]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.