【发布时间】:2020-12-08 06:20:41
【问题描述】:
我想在我的 php 代码中打印一个文本文件,但它给我的输出没有多行! 认为我的 txt 文件是这样的: (name = doc.txt)
hello guys!
we are here
Lemon is with You!
现在我的代码是:
<?php
$myfile = fopen("doc.txt", "r") or die("Unable to open file!");
echo fread($myfile, 100);
fclose($myfile);
?>
现在我的问题是我的输出:
大家好!我们在这里 柠檬与你同在!
我想要多行!怎么样?
【问题讨论】:
-
它已经是那种格式了。由于您在浏览器中查看,\n 对它没有意义。使用命令行查看。