On Monday 03 June 2002 23:37, Jas wrote:
Not sure how I could do this as I could not find a functions on php.net to
allow me to first delete the entire contents of a file before writting
the changes supplied by a textarea. Here is what I have thus far:
[snip]
As of right now it opens the
If you really want to delete the file contents then open the file in
write-only mode, like so:
$open_file = fopen($file_name,w);
-Naintara
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
t]On Behalf Of Jas
Sent: Monday, June 03, 2002 8:37 AM
To: [EMAIL PROTECTED]
On Mon, 2002-06-03 at 11:37, Jas wrote:
Not sure how I could do this as I could not find a functions on php.net to
allow me to first delete the entire contents of a file before writting the
changes supplied by a textarea. Here is what I have thus far:
Just fopen a file with the 'w' mode when
Try unlink($file_name) then fopen($file_name,rw)
unlink() deletes the whole file from the directory.
Hope this helps.
Hugh
- Original Message -
From: Jas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 03, 2002 8:37 AM
Subject: [PHP] delete file contents before writing?
Not
My mistake:
Try unlink() then touch() not fopen().
Hugh
- Original Message -
From: hugh danaher [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Monday, June 03, 2002 12:43 PM
Subject: Re: [PHP] delete file contents before writing?
Try unlink($file_name) then fopen($file_name,rw
5 matches
Mail list logo