note 22473 added to function.fputs

From: Date: Wed, 19 Jun 2002 11:24:48 +0000
Subject: note 22473 added to function.fputs
Groups: php.notes 
Request: Send a blank email to php-notes+get-32011@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); -- http://www.php.net/manual/en/function.fputs.php http://master.php.net/manage/user-notes.php?action=edit+22473 http://master.php.net/manage/user-notes.php?action=delete+22473 http://master.php.net/manage/user-notes.php?action=reject+22473

« previous php.notes (#32011) next »