does this not already do it? according the manual "w" as the second
parameters will "place the file pointer at the beginning of the file and
truncate the file to zero length".
Tim Ward
Senior Systems Engineer
Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: Jan Grafström [mailto:[EMAIL PROTECTED]]
> Sent: 20 February 2001 18:47
> To: [EMAIL PROTECTED]
> Subject: Can you make a file empty?
>
>
> Hi!
> I am trying to delete all text in a file.
> $yourfile = "file.txt";
> $fp = fopen($yourfile,w)
> "is there any good code to put in here?"
> fclose($fp);
>
> Thanks for any help.
>
> Regards
>
> Jan
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]