我有兩個文件文件獲取,並把內容以文本文件與新的生產線
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