RE: [PHP] RE: Can you make a file empty?

From: Date: Thu, 22 Feb 2001 11:14:33 +0000
Subject: RE: [PHP] RE: Can you make a file empty?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41130@lists.php.net to get a copy of this message
yeah, you can just fputs() an empty string in it and close the file. In this way you'll empty it all. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) maxim@phpbeginner.com www.phpbeginner.com -----Original Message----- From: Tim Ward [mailto:tim.ward@stivesdirect.com] Sent: Wednesday, February 21, 2001 8:30 PM To: 'jan@grafstrom.net'; php-general@lists.php.net Subject: [PHP] RE: Can you make a file empty? 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:jan@lillemanshus.com] > Sent: 20 February 2001 18:47 > To: php-general@lists.php.net > 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: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#41130) next »