我有两个文件文件获取,并把内容以文本文件与新的生产线
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是另一页source..i的的file_get_contents只能\r\n
取代<br>
标签,这仅仅是一个例。我还有其他复杂的部分要做。
我认为你需要做这样的事情'file_put_contents( “hello.txt的”,$你好)。 “\ n”;' –
当你替换时,你是否确保使用双引号'''而不是单引号''''$ string =“Hello \ r \ nWorld”;''会是'Hello [ NEWLINE] World''''string ='Hello \ r \ nWorld';'将会是'Hello \ r \ nWorld'(文字字符); – h2ooooooo
nope .. $ hello包含多个分隔线..如何工作 – Vishnu