我正在使用PHP生成一个文本文件,该文件将在具有Windows 2000 OS和mozilla firefox浏览器的计算机中使用(它的旧版本不问为什么请这样做)。该文件已正确生成,并且可以在Windows 10和最新版本的Fire Fox上顺利运行。
我现在的问题是,新行无法在旧版本(Windows 2000 OS和firefox 10)中呈现
我尝试使用ff:
1. /n
2. /r/n
3. <br>
4. $string = "This\r\nis\n\ra\nstring\r"; echo nl2br($string);
5. PHP_EOL
全部未生成所需的输出。它只是将BR添加为文本
代码为:
header("Content-Type: text/html; charset=UTF-8");
header("Content-Type: multipart/form-data; boundary=something");
header("Content-Length: ".strlen($data)."");
header("Content-Disposition: attachment; filename=".$_GET['name']."");
echo nl2br(base64_decode($data));
示例文本为:"Assembly Lot Summary Report " . "\r\n" . "\r\n" ;
FYI
:记事本(仅)用于打开文本文件