2014-07-13 28 views
1

文件我知道,追加到一個文件,我需要這樣做:追加與單一功能

fopen('file.txt', a); 
fwrite('file.txt', 'stuff'); 
fclose('file.txt'); 

,但我可以用一個函數來完成它,就像file_append_contents('file.txt', 'stuff')

編輯:我知道關於file_put_contents(),但iirc覆蓋整個文件。

+0

[**'file_put_contents()'**](http://php.net/manual/en/function.file-put-contents.php) – user1978142

回答

1

使用

file_put_contents('file1.txt',file_get_contents('file2.txt'));