我有两个文件
File1.php 和 File2.php
$hello = file_get_contents("file1.php");
file_put_contents("hello.txt",$hello);
file1.php 包含一些示例文本,如下所示
hello \r\n hi \r\n how are you.
我需要的是当我将内容放入 hello.txt 时,我希望这些单词出现在新行中,如下所示
hello
hi
how are you.
我尝试使用 \r\n 和 \n 但没有任何效果
注意: file1.php 是另一个页面源的 file_get_contents..i 只能替换<br>
标签, \r\n
这只是一个例子。我还有其他一些复杂的部分要做。