note 22473 deleted from function.fputs by hholzgra

From: Date: Fri, 12 Jul 2002 14:54:02 +0000
Subject: note 22473 deleted from function.fputs by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-32968@lists.php.net to get a copy of this message
RE: bojan feinerp@home.com sugessed: "Inside the second parameter, the mode, can contain two letters. So if you were to put an "a" and a "w" there, ex. $fp = fopen ("text.txt", "aw");" it didnt worked for me :( 1. i used reading from old file 2. adding it to new info 3. (over)writing it all to old file ex: $fp = fopen ($comfile, "r") or die("cannot open $comfile"); $oldcom = trim(fread($fp, filesize ($comfile))); fclose ($fp); $fp = fopen("$comfile","w") or die("cannot write $comfile"); $com=$com.$oldcom; fputs($fp, $com); fclose ($fp);

« previous php.notes (#32968) next »