Page 1 of 1

text file question

Posted: Thu Jan 14, 2010 5:47 pm
by intenseone345
Hello, would anyone know the php command to clear or delete the whole contents of a text file, not just a single line but all the contents?
thanks

Re: text file question

Posted: Thu Jan 14, 2010 5:54 pm
by AbraCadaver

Code: Select all

file_put_contents('/path/to/file.txt', '');

Re: text file question

Posted: Fri Jan 15, 2010 6:21 pm
by intenseone345
worked like a charm, thanks for the help