note 16534 added to function.fopen

From: Date: Sat, 03 Nov 2001 05:11:15 +0000
Subject: note 16534 added to function.fopen
Groups: php.notes 
Request: Send a blank email to php-notes+get-20348@lists.php.net to get a copy of this message
I've been having problems with using the r+ writing style. Its supposed to add the text straight to the top, correct? Well, when i do so, it replaces most/all of the text thats already there. Heres the code I use.. <? $new = "text to be added to the top"; $fp = fopen("/home/sites/cgi.phice.com/p/news.php", "r+"); fwrite($fp, $new); fclose($fp); ?> Email me if you have an answer! :) -- http://www.php.net/manual/en/function.fopen.php http://master.php.net/manage/user-notes.php?action=edit+16534 http://master.php.net/manage/user-notes.php?action=delete+16534 http://master.php.net/manage/user-notes.php?action=reject+16534

« previous php.notes (#20348) next »